You are viewing a single comment's thread. Return to all comments →
public static int maximumToys(List<int> prices, int k) { prices.Sort(); int count = 0; while((k - prices[count]) >= 0) k -= prices[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 →