Z54

Minimum Time to Complete Trips

Staff / Principal Engineer
Target Time: 40 - 50 Minutes
Type: NUMERIC

Problem Statement & Objective

You are given an array time where time[i] denotes the time taken by the ith bus to complete one trip. Return the minimum time needed so that all buses can make at least totalTrips trips.

Function Signature (Python)

minimum_time_trips(times: list[int], toplam_sefer: int) -> int

Input & Output Contract

Output Rule:Minimum zaman tam sayısı.

System Constraints

1 <= sureler.length <= 10^5
1 <= sureler[i], toplam_sefer <= 10^7

Example Execution Walkthrough

sureler = [1, 2, 3], toplam_sefer = 5
zaman = 3 birimde: 3/1 + 3/2 + 3/3 = 3 + 1 + 1 = 5 sefer tamamlanır -> cevap: 3

Example Test Scenarios (3)

Example 1
Input:[[1,2,3],5]
Expected Output:3
Example 2: Tek Otobüs
Input:[[2],1]
Expected Output:2
Example 3: 25 birimde 5 + 2 + 2 = 9
Input:[[5,10,10],9]
Expected Output:25
Loading Python Editor...
Input Parameters
[
  [
    1,
    2,
    3
  ],
  5
]
Expected Output
3