https://school.programmers.co.kr/learn/courses/30/lessons/43238
def solution(n, times):
answer = 0
left = 1
right = max(times) * n
while left < right:
mid = (left + right) // 2
people = 0
for time in times:
people += mid // time
if people >= n:
right = mid # 처리 인원이 n 이상이면 시간을 줄이기
else:
left = mid + 1 # 처리 인원이 n 미만이면 시간을 늘리기
return left # left와 right가 만나는 지점이 최소 시간
처음에 이진탐색 아이디어를 떠올리기 쉽지 않았다. 앞으로 더 많은 문제를 풀어서 어떤 알고리즘으로 풀어야할 지 익히자!