Loading...
Loading...
Loading...
A sales team logs the revenue for n days. A streak is a run of days in a row where each day is strictly above a target t. Print the length of the longest streak, or 0 if there is none.
Example
Input
8 5 7 8 3 9 9 9 2 6
Output
3
The days 9 9 9 are three days above 5 in a row.
Try the problem first. Open one hint at a time.
Keep a counter of the current streak and reset it to 0 on a day that is not above t.
Keep the largest counter seen.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor