Skip to content

Commit 045c2fd

Browse files
committed
[level 1] Title: 예산, Time: 0.03 ms, Memory: 9.34 MB -BaekjoonHub
1 parent 3c95876 commit 045c2fd

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

프로그래머스/1/12982. 예산/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### 성능 요약
66

7-
메모리: 10 MB, 시간: 0.01 ms
7+
메모리: 9.34 MB, 시간: 0.03 ms
88

99
### 구분
1010

@@ -16,7 +16,7 @@
1616

1717
### 제출 일자
1818

19-
2024년 07월 04일 21:52:21
19+
2026년 01월 05일 15:16:06
2020

2121
### 문제 설명
2222

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
def solution(d, budget):
22
d.sort()
3-
cnt = 0
3+
ans = 0
44
for i in d:
5-
if budget-i >= 0:
6-
budget -= i
7-
cnt += 1
8-
else:
5+
if budget - i < 0:
96
break
10-
return cnt
7+
else:
8+
budget -= i
9+
ans += 1
10+
return ans

0 commit comments

Comments
 (0)