Skip to content

Commit 9c2b840

Browse files
committed
[level 2] Title: 할인 행사, Time: 51.30 ms, Memory: 123 MB -BaekjoonHub
1 parent db28aa2 commit 9c2b840

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

프로그래머스/2/131127. 할인 행사/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# [level 2] 할인 행사 - 131127
22

3-
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/131127#qna)
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/131127)
44

55
### 성능 요약
66

7-
메모리: 125 MB, 시간: 54.79 ms
7+
메모리: 123 MB, 시간: 51.30 ms
88

99
### 구분
1010

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

1717
### 제출 일자
1818

19-
2025년 07월 03일 18:08:55
19+
2025년 07월 03일 18:16:46
2020

2121
### 문제 설명
2222

프로그래머스/2/131127. 할인 행사/할인 행사.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ public int solution(String[] want, int[] number, String[] discount) {
2424
// 원하는 수량을 살 수 있는지 검사
2525
boolean check = true;
2626
for (String key : product.keySet()) {
27-
if (map.getOrDefault(key, 0) != product.get(key)) {
27+
if (map.getOrDefault(key, 0) != product.get(key)) { //product에는 있지만 map에는 없는 경우 고려(할인 품목이 아님)
2828
check = false;
2929
break;
3030
}
3131
}
32-
// System.out.println(check);
3332
if(check){
3433
result++;
3534
}

0 commit comments

Comments
 (0)