FunctionRacerProblemsRace

Longest Increasing Run

BeginnerArraysPython, JavaScript, TypeScript, Java, C++

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

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Arrays problems