def solution(d, budget):
answer = 0
d.sort()
for i in d:
if budget < i:
break
budget -= i
answer += 1
return answer
'문제풀이 > 프로그래머스' 카테고리의 다른 글
[프로그래머스][Lv1] - 서울에서 김서방 찾기(Python) (0) | 2021.10.18 |
---|---|
[프로그래머스][Lv1] - 가운데 글자 가져오기(Python) (0) | 2021.10.18 |
[프로그래머스][Lv1] - [1차] 다트 게임 (Python) (0) | 2021.10.18 |
[프로그래머스][Lv1] - 크레인 인형뽑기 게임 (Python) (0) | 2021.10.17 |
[프로그래머스][Lv1] - 실패율 (Python) (0) | 2021.10.17 |