BlueBook - Mode

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 16M

Problem type
BlueBook

Determine the mode of a set of data.

Input Specification

A sequence of lines. Each line will contain a non-negative integer no greater than 100 and represents one element of the data, except the last line, which will contain the single integer -1 and is not part of the data.

Output Specification

The mode of the set of data. If there is more than one mode, output all modes sorted in ascending order on separate lines.

Sample Input

2
3
4
4
-1

Sample Output

4

Comments


  • 0
    maxcruickshanks  commented on June 6, 2025, 11:46 p.m. edited

    Since the original data were weak, an additional test case was added worth 10 points, and all submissions were rejudged. The issue was noticed by uselessleaf, and the data were provided by maxcruickshanks.