Skip to content

Commit b698c68

Browse files
committed
[level 1] Title: 햄버거 만들기, Time: 359.23 ms, Memory: 25.5 MB -BaekjoonHub
1 parent ab06d43 commit b698c68

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

프로그래머스/1/133502. 햄버거 만들기/README.md

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

55
### 성능 요약
66

7-
메모리: 25.5 MB, 시간: 267.74 ms
7+
메모리: 25.5 MB, 시간: 359.23 ms
88

99
### 구분
1010

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

1717
### 제출 일자
1818

19-
2026년 02월 13일 10:23:39
19+
2026년 02월 13일 10:24:59
2020

2121
### 문제 설명
2222

프로그래머스/1/133502. 햄버거 만들기/햄버거 만들기.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ def solution(ingredient):
33
stack = []
44
for i in ingredient:
55
stack.append(i)
6-
while len(stack) > 3:
7-
if stack[-4:] == [1, 2, 3, 1]:
8-
cnt += 1
9-
for _ in range(4):
10-
stack.pop()
11-
else: break
6+
if len(stack) > 3 and stack[-4:] == [1, 2, 3, 1]:
7+
cnt += 1
8+
for _ in range(4):
9+
stack.pop()
10+
1211
return cnt

0 commit comments

Comments
 (0)