programmers.co.kr/learn/courses/30/lessons/42586
My answer:
from collections import deque
def solution(progresses, speeds):
answer = []
dq_progresses=deque(progresses)
dq_speeds=deque(speeds)
while(dq_progresses):
answer_fac=0
for i in range(len(dq_speeds)):
dq_progresses[i]+=dq_speeds[i]
while True:
if dq_progresses and dq_progresses[0]>=100:
answer_fac+=1
dq_progresses.popleft()
dq_speeds.popleft()
else:
break
if answer_fac!=0:
answer.append(answer_fac)
return answer
'Computer Science > 알고리즘 문제풀이' 카테고리의 다른 글
[백준][python]10809. 알파벳 찾기 (0) | 2021.12.20 |
---|---|
[프로그래머스][python]두 개 뽑아서 더하기 (0) | 2021.12.20 |
[프로그래머스][python]12922. 수박수박수박수박수박수? (0) | 2021.01.09 |
[프로그래머스][python]12943. 콜라츠 추측 (0) | 2021.01.08 |
[프로그래머스][python]12915. 문자열 내 마음대로 정렬하기 (0) | 2021.01.08 |