You are viewing a single comment's thread. Return to all comments →
This will take care of all the cases: def pickingNumbers(a): c=0 s=set(a) for i in s: p=a.count(i)+a.count(i+1) if c < p: c=p return c
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 →
This will take care of all the cases: def pickingNumbers(a): c=0 s=set(a) for i in s: p=a.count(i)+a.count(i+1) if c < p: c=p return c