https://school.programmers.co.kr/learn/courses/30/lessons/42586
# 기능 개발
def solution(progresses, speeds):
import math
need_days = [] # 각 기능 개발까지 필요한 날짜
for x, y in zip(progresses, speeds):
need_day = math.ceil((100 - x) / y)
need_days.append(need_day)
answer = []
threshold = need_days[0]
cnt = 0
for i in range(0, len(need_days)):
if threshold >= need_days[i]:
cnt += 1
else:
answer.append(cnt)
cnt = 1
threshold = need_days[i]
answer.append(cnt)
return answer
'알고리즘 > 프로그래머스' 카테고리의 다른 글
[Python] n^2 배열 자르기 (0) | 2022.12.20 |
---|---|
[Python] 최고의 집합 (1) | 2022.12.19 |
[Python] 이중 우선순위 큐 (0) | 2022.12.09 |
[Python] 정수 삼각형 (0) | 2022.12.08 |
[Python] 위장 (0) | 2022.12.07 |