You are viewing a single comment's thread. Return to all comments →
Pretty much what I did, but I think my syntax is worth a look; it seems more Pythonic to me.
def toys(w): ws = set(w) ct = 0 while ws: mw = min(ws) ws -= set(range(mw, mw+5)) ct += 1 return ct input() w = [int(s) for s in input().split()] print(toys(w))
Seems like cookies are disabled on this browser, please enable them to open this website
Priyanka and Toys
You are viewing a single comment's thread. Return to all comments →
Pretty much what I did, but I think my syntax is worth a look; it seems more Pythonic to me.