You are viewing a single comment's thread. Return to all comments →
Python
def pickingNumbers(a): cnt = [0] * (max(a) + 1) for num in a: cnt[num] += 1 res = 0 for i in range(len(cnt) - 1): curr_sum = cnt[i] + cnt[i + 1] if curr_sum > res: res = curr_sum return res
Seems like cookies are disabled on this browser, please enable them to open this website
Picking Numbers
You are viewing a single comment's thread. Return to all comments →
Python