You are viewing a single comment's thread. Return to all comments →
javascript
function maximumToys(prices, k) { let sorted = prices.sort((a, b) => a - b), count = 0, sum = 0 for (; sum + sorted[count] <= k; count++) sum += sorted[count] return count }
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 →
javascript