Loading...
Loading...
Loading...
A sensor logs readings. Print the length of the longest run of equal readings next to each other. The starter holds a program with a bug. Find it and fix it.
Example
Input
7 1 1 2 2 2 3 3
Output
3
The run of three 2s is longest.
Try the problem first. Open one hint at a time.
Walk through the list and count the length of the current run.
The run that ends at the last item also has to be compared.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor