You are viewing a single comment's thread. Return to all comments →
python
def maximumToys(prices, k): res = 0 sum_price = 0 for price in sorted(prices): if sum_price + price > k: break res += 1 sum_price += price return res
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 →
python