def solution(d, budget): answer = 0 d.sort() for e in d: if budget - e >= 0: budget -= e answer += 1 return answer