-
[programmers] 스택/큐 - 기능개발Algorithm/python tip 2021. 3. 2. 00:52
programmers.co.kr/learn/courses/30/lessons/42586
코딩테스트 연습 - 기능개발
프로그래머스 팀에서는 기능 개선 작업을 수행 중입니다. 각 기능은 진도가 100%일 때 서비스에 반영할 수 있습니다. 또, 각 기능의 개발속도는 모두 다르기 때문에 뒤에 있는 기능이 앞에 있는
programmers.co.kr
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