728x90
programmers.co.kr/learn/courses/30/lessons/42586
코딩테스트 연습 - 기능개발
프로그래머스 팀에서는 기능 개선 작업을 수행 중입니다. 각 기능은 진도가 100%일 때 서비스에 반영할 수 있습니다. 또, 각 기능의 개발속도는 모두 다르기 때문에 뒤에 있는 기능이 앞에 있는
programmers.co.kr
def solution(progresses, speeds):
day = []
for i in range(len(progresses)):
d = (100-progresses[i])/speeds[i]
if d != int(d):
d = int(d) + 1
day.append(d)
answer = [1]
first = day[0]
for i in range(1, len(day)):
if first < day[i]:
answer.append(1)
first = day[i]
else:
answer[-1]+=1
return answer
반응형
'전.py' 카테고리의 다른 글
프로그래머스 문자열 내 마음대로 정렬하기 (level 1) (0) | 2021.01.04 |
---|---|
프로그래머스 문자열 압축 (level 2) (0) | 2021.01.02 |
프로그래머스 스킬트리 (level 2) (0) | 2021.01.01 |
프로그래머스 주식가격 (level 2) (0) | 2020.12.31 |
프로그래머스 시저 암호 (level 1) (0) | 2020.12.30 |