Share your repls and programming experiences

← Back to all posts
6.E. While: Widest fragment
pole55 (196)

Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Determine the length of the widest fragment where all the elements are equal to each other.

Example input
1
7
7
9
1
0

Example output
2