Longest Steady Climb
A hiker's watch records the altitude at every step in the list readings. A steady climb is a run of readings in a row where each one is strictly higher than the one before it. Return the length of the longest steady climb, counted in readings.
A single reading is a climb of length 1; an empty list has no climb at all, so the answer is 0.
Examples
readings = [3, 4, 7, 2, 5, 6, 8, 1] → 4
readings = [5, 5, 5] → 1
readings = [9, 7, 4] → 1
readings = [1, 2, 3, 4] → 4In the first example 2, 5, 6, 8 rise all the way: 4 readings. In the second, staying at the same altitude is not climbing.
Constraints
- Between 0 and 20,000 readings, each between -10,000 and 10,000.
- Aim for O(n): walk the readings once.
Console
›Run to see what your code prints
Run checks the 4 visible cases here, in your browser. Submit runs all 8 on the judge, 4 of them hidden, and measures how your solution scales.
Expected is the reference solution's answer, from the judge. An input that breaks the statement's other rules may get any answer.