You are viewing a single comment's thread. Return to all comments →
One explicite loop only.
def pickingNumbers(a): a.sort()
cntmax = 0 for el in a[:] : cnt0 = a.count(el) cnt1 = a.count(el+1) cntmax = max(cntmax, cnt0+cnt1) a = a[cnt0:] return cntmax
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 →
One explicite loop only.
def pickingNumbers(a): a.sort()