Sum of Consecutive Subsequences
Process values left to right, keeping for each value the chains that rise or fall by one into it, and add their sums.
Process values left to right, keeping for each value the chains that rise or fall by one into it, and add their sums.