링크: https://www.acmicpc.net/problem/11652
N = int(input())
dic = {}
for tc in range(N):
num = int(input())
if dic.get(num, 0):
dic[num] += 1
else:
dic[num] = 1
dic = sorted(dic.items(), key = lambda x : (-x[1], x[0]))
print(dic[0][0])
핵심: sorted(인자, key = lambda x : (-x[1], x[0]))
람다에 2차원 리스트를 조건식으로 주면
{'a': 2, 'b': 3}
[('b', 3), ('a', 2)]
[('a', 2), ('b', 3)]