We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c95876 commit 045c2fdCopy full SHA for 045c2fd
2 files changed
프로그래머스/1/12982. 예산/README.md
@@ -4,7 +4,7 @@
4
5
### 성능 요약
6
7
-메모리: 10 MB, 시간: 0.01 ms
+메모리: 9.34 MB, 시간: 0.03 ms
8
9
### 구분
10
@@ -16,7 +16,7 @@
16
17
### 제출 일자
18
19
-2024년 07월 04일 21:52:21
+2026년 01월 05일 15:16:06
20
21
### 문제 설명
22
프로그래머스/1/12982. 예산/예산.py
@@ -1,10 +1,10 @@
1
def solution(d, budget):
2
d.sort()
3
- cnt = 0
+ ans = 0
for i in d:
- if budget-i >= 0:
- budget -= i
- cnt += 1
- else:
+ if budget - i < 0:
break
- return cnt
+ else:
+ budget -= i
+ ans += 1
+ return ans
0 commit comments