from collections import Counter
def solution(progresses, speeds):
days = []
for p,s in zip(progresses,speeds):
spend = ((100-p)//s if (100-p)%s == 0 else (100-p)//s+1)
if days and days[-1] > spend:
days.append(days[-1])
else:
days.append(spend)
return [x[1] for x in sorted(Counter(days).items())]
빠르게 풀었다
'Code IT > Algorithm' 카테고리의 다른 글
[프로그래머스] 신규 아이디 추천 (Python) (0) | 2022.07.22 |
---|---|
[프로그래머스] 신고 결과 받기 (Python) (0) | 2022.07.22 |
[프로그래머스] 위장 (Python) (0) | 2022.03.13 |
[구름에듀] 빙글빙글1 (Python) (0) | 2022.03.12 |
[구름에듀] 놀이공원 (Python) (0) | 2022.03.11 |
댓글