requests = [1, 3, 2, 5, 4]
budget = 9
count = 0

requests.sort()

for i in range(len(requests)):
    budget -= requests[i]
    count += 1
    if budget <= 0:
        break

print(count)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: