2187. Minimum Time to Complete Trips

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2187

class Solution:
    def minimumTime(self, time: List[int], totalTrips: int) -> int:
        mx = min(time) * totalTrips
        return bisect_left(
            range(mx), totalTrips, key=lambda x: sum(x // v for v in time)
        )