You are viewing a single comment's thread. Return to all comments →
Python 3
from itertools import accumulate def maximumToys(prices, k): return sum(s <= k for s in accumulate(sorted(prices)))
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 3