2187. Minimum Time to Complete Trips

Updated: 2024-03-12
1 min read
[]

On This Page

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)
        )