You are viewing a single comment's thread. Return to all comments →
Python 1 liner: O(N)
return max(Counter(arr).items(), key= lambda i: 10*i[1] + 5-i[0])[0]
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 →
Python 1 liner: O(N)