Share your repls and programming experiences

← Back to all posts
6.D. While: Number of maxima
pole55 (196)

Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Find how many elements of this sequence are equal to its largest element.

Example input #1
1
7
9
0

Example output #1
1

Example input #2
1
3
3
1
0

Example output #2
2