requests = [2, 2, 3, 3] budget = 10 count = 0 requests.sort() for i in range(len(requests)): if requests[i] > budget: break budget -= requests[i] count += 1 print(count)
To embed this project on your website, copy the following code and paste it into your website's HTML: