Skip to content

Commit c41180a

Browse files
committed
94차 3번 문제 풀이(푸는중)
1 parent 1cdfc45 commit c41180a

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

live9/test94/문제3/박희경.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
def solution(stones, k):
2+
answer = 0
3+
4+
i, j = 0, 1
5+
while j < len(stones) and j-i <= k:
6+
if stones[j] == 0:
7+
j += 1
8+
i += 1
9+
j += 1
10+
# for i in range(len(stones)):
11+
# if stones[i] == 0:
12+
# jump += 1
13+
# i += jump - 1
14+
# else:
15+
# stones[i] -= 1
16+
answer += 1
17+
# print(stones)
18+
19+
return answer

0 commit comments

Comments
 (0)