Skip to content

Commit a247d53

Browse files
author
hangyeol
committed
94차 3번 문제풀이
1 parent 6405779 commit a247d53

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

live9/test94/문제3/백한결.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def solution(stones, k):
2-
start = 0
3-
end = len(stones) - 1
2+
start = 1
3+
end = max(stones)
44
max_friends = 0
55

66
while start <= end:
@@ -20,15 +20,12 @@ def checkUnderZero(stones, k, friends):
2020
count = 0
2121

2222
for stone in stones:
23-
if stone - friends <= 0:
23+
if stone - friends < 0:
2424
count += 1
2525
else:
2626
count = 0
2727

2828
if count >= k:
2929
return False
3030

31-
return True
32-
33-
34-
print(checkUnderZero([2, 4, 5, 3, 2, 1, 4, 2, 5, 1], 3, 2))
31+
return True

0 commit comments

Comments
 (0)