← Back to List

24085번: 希少な数 (Rare Number) ↗

Solutions

Python 3
174 B | 174 chars
n = int(input())
l = [*map(int,input().split())]

d = {}
for i in l:
  try:
    d[i] += 1
  except:
    d[i] = 1

print(sorted(d.items(), key=lambda t : (t[1], t[0]))[0][0])