values. Return how many contiguous pieces (subarrays) it has in which every element is strictly greater than the one before it.
A piece of a single element counts as rising too.values=[2, 5, 7, 7, 3, 4] → 10
There are six pieces of length 1; the rising pieces of length 2 are [2, 5], [5, 7], [3, 4]; of length 3, [2, 5, 7]. That makes 10.
values=[9, 8, 7] → 3
The array only goes down, so only the single elements count.
values=[1, 2, 3, 4] → 10
values=[2, 5, 7, 7, 3, 4]
10
Run checks the first 3 tests in your browser. Submit checks all 129 tests on the server, hidden ones included.