You are viewing a single comment's thread. Return to all comments →
def pickingNumbers(a): d={} for x in a: d[x] = d[x]+1 if x in d else 1 result=max(d.values()) keys=sorted(d.keys()) for i in range(1,len(keys)): if keys[i]-keys[i-1]==1: val=d[keys[i]]+d[keys[i-1]] if val>result: result=val return result
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 →