mfgnik

Untitled

May 12th, 2020
870
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. from collections import Counter
  2.  
  3. n = int(input())
  4. counter = Counter(map(int, input().split()))
  5. max_count = 0
  6. max_number = 0
  7. for number, count in counter.items():
  8.     if count > max_count or count == max_count and number > max_number:
  9.         max_count, max_number = count, number
  10. print(max_number)
Advertisement
Add Comment
Please, Sign In to add comment