Election

AtCoder
IDabc231_b
Time2000ms
Memory256MB
Difficulty
An election is taking place. $N$ people voted. The $i$\-th person $(1 \leq i \leq N)$ cast a vote to the candidate named $S_i$. Find the name of the candidate who received the most votes. The given input guarantees that there is a unique candidate with the most votes. ## Constraints * $1 \leq N \leq 100$ * $S_i$ is a string of length between $1$ and $10$ (inclusive) consisting of lowercase English letters. * $N$ is an integer. * There is a unique candidate with the most votes. ## Input Input is given from Standard Input in the following format: $N$ $S_1$ $S_2$ $\vdots$ $S_N$ [samples]
Samples
Input #1
5
snuke
snuke
takahashi
takahashi
takahashi
Output #1
takahashi

`takahashi` got $3$ votes, and `snuke` got $2$, so we print `takahashi`.
Input #2
5
takahashi
takahashi
aoki
takahashi
snuke
Output #2
takahashi
Input #3
1
a
Output #3
a
API Response (JSON)
{
  "problem": {
    "name": "Election",
    "description": {
      "content": "An election is taking place. $N$ people voted. The $i$\\-th person $(1 \\leq i \\leq N)$ cast a vote to the candidate named $S_i$. Find the name of the candidate who received the most votes. The given in",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc231_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "An election is taking place.\n$N$ people voted. The $i$\\-th person $(1 \\leq i \\leq N)$ cast a vote to the candidate named $S_i$.\nFind the name of the candidate who received the most votes. The given in...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments