Rising Run
mediumA cyclist's training app logs one power reading per session. She wants the longest possible improvement chain: a selection of sessions, in chronological order (not necessarily consecutive), where every reading is strictly higher than the one before.
Given the list readings, return the length of the longest such chain.
Example 1
in readings = [10, 9, 2, 5, 3, 7, 101, 18]
out 4
One longest chain: 2, 5, 7, 101 (also 2, 3, 7, 18).
Example 2
in readings = [7, 7, 7]
out 1
Strictly higher — equal readings can't chain.
Constraints
- · 1 <= len(readings) <= 1000
- · -10^4 <= readings[i] <= 10^4
solution.py● loading python…
test results
Hit ▶ Run to test your code against the visible cases.