코딩테스트 연습 - 기능개발
프로그래머스 팀에서는 기능 개선 작업을 수행 중입니다. 각 기능은 진도가 100%일 때 서비스에 반영할 수 있습니다. 또, 각 기능의 개발속도는 모두 다르기 때문에 뒤에 있는 기능이 앞에 있는
programmers.co.kr
def solution(progresses, speeds):
answer = []
while progresses:
#업데이트
for i in range(len(progresses)):
progresses[i] += speeds[i]
# 만약 첫번째꺼가 완료되면 완료된 애들 뺀다.
if progresses[0] >= 100:
cnt = 0
while progresses:
if progresses[0] >= 100:
progresses.pop(0)
speeds.pop(0)
cnt += 1
else:
break
answer.append(cnt)
return answer
'Programming > Programmers' 카테고리의 다른 글
[프로그래머스/Python] 소수찾기(완전탐색) (0) | 2021.01.03 |
---|---|
[프로그래머스/Python] 괄호변환(재귀/구현) (0) | 2021.01.03 |
[프로그래머스/Python] 주식가격(스택) (0) | 2021.01.03 |
[프로그래머스/Python] 프린터(큐) (0) | 2021.01.03 |
[프로그래머스/Python] 수식 최대화 (반복/재귀) (0) | 2021.01.02 |