-
[programmers] 스택/큐 - 기능개발Algorithm/python tip 2021. 3. 2. 00:52
programmers.co.kr/learn/courses/30/lessons/42586
def solution(progresses, speeds): working = 0 cnt = 0 ans = [] # 처음 배포해야할 작업이 완료 될때까지 작업 진행 while working < len(progresses): while progresses[working] < 100: for i in range(working, len(progresses)): if progresses[i] < 100: progresses[i] += speeds[i] # 배포 가능한 작업 모두 배포 complete = 0 for i in range(working, len(progresses)): if progresses[i] >= 100: complete += 1 else: break working += complete ans.append(complete) return ans
'Algorithm > python tip' 카테고리의 다른 글
807. Max Increase to Keep City Skyline (0) 2021.03.02 1046. Last Stone Weight (0) 2021.03.02 1588. Sum of All Odd Length Subarrays (0) 2021.03.01 1732. Find the Highest Altitude (0) 2021.03.01 1679. Max Number of K-Sum Pairs (0) 2021.03.01