Stax, 27 25 23 18 bytes
«╥╦.ê§┘h!@ÆEÿ☺╜╫♥B
Output is separated by newlines. This is
This program operates on adjacent pairs in the array, and determines whether there should be a completely different algorithm that what I had beforesplit between them using this procedure. I think there's still
Consider some golfing potentialarbitrary input [... w x y z ...]
. I'll try Here is how to improvedetermine if there should be a split between x
and annotate it latery
.
- If
x == y
, then yes. - If
x > y
, then iffz >= x
. - If
y > x
, then iffw >= y
.
The summing is left as an exercise.