The Most Common Answer
Fernhill Media runs a one-question reader survey: pick the option number that best describes you. The site stores one option number per response, in the order the responses arrived. Before the results page can headline a winner, the editor needs the option that was chosen most often — the mode. The data is guaranteed to have one clear winner, so no two options are level at the top.
Task: Print the option number that appears most often.
Input
The first line holds one integer n, how many responses follow. Each of the next n lines holds one response as a whole number. Options repeat freely and arrive in no particular order. Exactly one option appears more times than every other.
Output
One line holding that option number, as a plain whole number with nothing else on the line.
Example:
Input:
5
3
1
3
2
3
Output:
3
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in