Maximum Value of an Alternating Sequence
Zigzag up and down from a start value, climbing as far as each step allows on the up moves and dropping by the smallest amount on the down moves. The highest point reached is the answer.
Zigzag up and down from a start value, climbing as far as each step allows on the up moves and dropping by the smallest amount on the down moves. The highest point reached is the answer.