You are viewing a single comment's thread. Return to all comments →
def maximumToys(prices, k): prices.sort() for i in range(len(prices)+1): if(sum(prices[0:i])<k): pass elif(sum(prices[0:i])>k): return i-1 elif(sum(prices[0:i])==k): return i
Seems like cookies are disabled on this browser, please enable them to open this website
Mark and Toys
You are viewing a single comment's thread. Return to all comments →