Coding Test
[프로그래머스] 기능개발
상상쓰
2021. 7. 1. 15:44
https://programmers.co.kr/learn/courses/30/lessons/42586
코딩테스트 연습 - 기능개발
프로그래머스 팀에서는 기능 개선 작업을 수행 중입니다. 각 기능은 진도가 100%일 때 서비스에 반영할 수 있습니다. 또, 각 기능의 개발속도는 모두 다르기 때문에 뒤에 있는 기능이 앞에 있는
programmers.co.kr
문제에서 하라는 대로 했다.
import math
def solution(progresses, speeds):
answer = []
jobs = []
N = len(progresses)
M = math.ceil((100 - progresses[0]) / speeds[0])
e = 0
for i in range(1, N):
m = math.ceil((100 - progresses[i]) / speeds[i])
if M < m:
M = m
answer.append(e + 1)
e = 0
else:
e += 1
if i == N - 1:
answer.append(e + 1)
return answer
print(solution([93, 30, 55], [1, 30, 5])) # [2, 1]