You are viewing a single comment's thread. Return to all comments →
Python 3:
def migratoryBirds(arr): arr_cnt = dict(Counter(arr)) arr_dict = {i:v for i, v in sorted(arr_cnt.items(), key=lambda x: x[1])} arr_val = list(arr_dict.values())[-1] key = sorted([k for k, vv in arr_dict.items() if vv==arr_val])[0] return key
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 3: