You are viewing a single comment's thread. Return to all comments →
Java
Collections.sort(prices); int sum = 0; int count = 0; for(Integer i : prices){ sum += i; if(sum > k){ break; } else{ 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 →
Java