Solve problem "The maximum number of consecutive equal elements" online - Learn Python 3 - Snakify

Problem «The maximum number of consecutive equal elements» (Hard)


Statement

Given a sequence of integer numbers ending with the number 0. Determine the length of the widest fragment where all the elements are equal to each other.

In all the problems input the data using input() and print the result using print().



Saved solutions

Tests

Input Correct answer Result
1
7
7
9
1
0
2
1
2
3
4
5
6
7
8
9
10
11
0
1
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
0
15
6
0
1
1
2
3
2
3
3
2
4
4
4
4
2
3
3
3
2
2
3
0
4
1
2
2
1
2
1
2
1
2
0
2
1
2
2
0
2
2
2
1
0
2
1
2
3
3
2
2
4
4
4
4
4
5
5
5
6
3
3
3
3
3
3
5
5
5
5
3
3
3
4
5
5
5
0
6
1
2
1
1
1
2
0
3
2
1
1
1
1
2
1
0
4