You are viewing a single comment's thread. Return to all comments →
def maximumToys(prices, k): prices.sort() i=0 while sum(prices[:i]) <= k: i+=1 return i-1
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 →