Skip to content

Instantly share code, notes, and snippets.

@crazydiver
Created October 13, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazydiver/c506850a02a7d93904e0eedcfa86ac4c to your computer and use it in GitHub Desktop.
Save crazydiver/c506850a02a7d93904e0eedcfa86ac4c to your computer and use it in GitHub Desktop.
competitors = [0] * (int(input()))
for election in map(int, input().split()):
if 0 < election <= len(competitors):
competitors[election - 1] += 1
if len(competitors) > 0:
win_res = max(competitors)
else:
win_res = 0
if win_res != 0:
for i in range(len(competitors)):
if competitors[i] == win_res:
print(i + 1, end=' ')
else:
print(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment