#C8653. Election Winner

    ID: 52659 Type: Default 1000ms 256MiB

Election Winner

Election Winner

Given an integer \(n\) and a list of \(n\) integers representing the votes received by each candidate, determine the index of the candidate with the highest number of votes. In the event of a tie, the candidate with the smallest (earliest) index is declared the winner.

Note: If no candidates are available (i.e. the list is empty), output \(-1\).

inputFormat

The first line contains a single integer \(n\) representing the number of candidates. The second line (if \(n > 0\)) contains \(n\) space-separated integers representing the votes for each candidate.

outputFormat

Output a single integer which is the index (0-indexed) of the winning candidate. If no candidate exists, output \(-1\).

## sample
1
12
0

</p>