#C5844. Determine the Tournament Winner
Determine the Tournament Winner
Determine the Tournament Winner
You are given ( n ) players participating in a tournament, where each player is assigned a skill level. The tournament's outcome is determined by the highest skill level; the player with the maximum skill is the most likely winner. If more than one player shares the maximum skill level, the one who appears first (i.e. with the smallest index) is considered the winner. Your task is to identify the 1-based index of the winning player.
Note on indexing: The output should be based on 1-indexing. For example, if the winning player is the first in the list, the answer should be 1.
inputFormat
Input is read from standard input (stdin). The first line contains a single integer ( n ) representing the number of players. The second line contains ( n ) space-separated integers representing the skill levels of each player.
outputFormat
Output a single integer which is the 1-based index of the player most likely to win the tournament, printed to standard output (stdout).## sample
4
5 9 3 2
2