FunctionRacerProblemsRace

Runs of Equal Values

HardNumPyPython

A run is a stretch of equal neighbors in values. Return the runs in order as [value, length] pairs. No loops: for and while are not allowed.

Example 1

values [5,5,2,2,2,5]
returns [[5,2],[2,3],[5,1]]

5 comes back at the end, and that is a new run of its own.

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 NumPy problems