Longest Increasing Run
A run is a stretch of neighbouring items where each item is strictly bigger than the one before it. Return the length of the longest run in nums. A single item is a run of length 1.
Example 1
nums [1,3,5,4,7]
returns 3
The run 1, 3, 5 has length 3.
Example 2
nums [2,2,2]
returns 1
Equal neighbours break a run, so 1.
Constraints
1 <= len(nums) <= 50-100 <= nums[i] <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Arrays problems
- Max Consecutive OnesBeginner
- Peak So FarBeginner
- Running Sum of an ArrayBeginner
- Second AppearanceBeginner
- Shift Right and FillBeginner
- Shuffle the ArrayBeginner
- Sort by ParityBeginner
- Trend SignsBeginner