Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import Counter
- n = int(input())
- counter = Counter(map(int, input().split()))
- max_count = 0
- max_number = 0
- for number, count in counter.items():
- if count > max_count or count == max_count and number > max_number:
- max_count, max_number = count, number
- print(max_number)
Advertisement
Add Comment
Please, Sign In to add comment