You are viewing a single comment's thread. Return to all comments →
n = int(input()) arr = list(map(int(input().strip().split(" ")))) d={} for i in arr: d[i] = arr.count(i)
maxfreq = max(d.values()) result = 10000 for i in d: if d[i] == maxfreq: result = min(i,result) print(result)
Seems like cookies are disabled on this browser, please enable them to open this website
Migratory Birds
You are viewing a single comment's thread. Return to all comments →
n = int(input()) arr = list(map(int(input().strip().split(" ")))) d={} for i in arr: d[i] = arr.count(i)
maxfreq = max(d.values())
result = 10000 for i in d: if d[i] == maxfreq: result = min(i,result) print(result)