DevYoon
[νλ‘κ·Έλλ¨Έμ€] κΈ°λ₯κ°λ° (Python) λ³Έλ¬Έ
link π https://programmers.co.kr/learn/courses/30/lessons/42586
import math
def solution(progresses, speeds):
answer = []
length = len(progresses)
left = [0]*length
for idx in range(length):
left[idx] = math.ceil((100-progresses[idx])/speeds[idx])
idx = 1
temp = 0
while True:
if len(left) == 1:
answer.append(temp+1)
break
if left[0] >= left[idx]:
temp += 1
left.pop(idx)
elif left[0] < left[idx]:
answer.append(temp+1)
left.pop(0)
idx = 1
temp = 0
return answer