https://programmers.co.kr/learn/courses/30/lessons/42627#
def solution(jobs):
answer = 0
jobs.sort(key= lambda x : x[1])
job_length = len(jobs)
time = 0
while True:
for idx, job in enumerate(jobs):
start = job[0]
length = job[1]
if start <= time:
answer += length + time - start
time += length
del jobs[idx]
break
else:
time +=1
if len(jobs) ==0:
break
return answer//job_length