L2 : 기능개발 Python

jhyunn·2023년 1월 16일
0

Programmers

목록 보기
26/69

L2 : 기능개발 Python

https://school.programmers.co.kr/learn/courses/30/lessons/42586?language=python3

import math

def solution(progresses, speeds):
    times = [math.ceil((100 - p) / s) for p, s in zip(progresses, speeds)]
    
    temp, answer = [], []
    for t in times:
        try:
            if t <= temp[0]:
                temp.append(t)
            else:
                answer.append(len(temp))
                temp = [t]
        except:
            temp.append(t)
            
    answer.append(len(temp))
    return answer

#math #ceil #floor #abs

profile
https://github.com/Sungjeonghyun

0개의 댓글