• + 0 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