Practice Minimum Time to Transport All Individuals
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Minimum Time to Transport All Individuals
Problem Statement
Transport n people across a river using a boat carrying at most k people. Conditions cycle through m stages, beginning at stage 0. A departing group takes the largest time[i] among its members multiplied by mul[currentStage]. After a crossing lasting d, advance the stage by floor(d) modulo m. If anyone remains at the starting bank, one person on the destination bank must return the boat; their return takes time[i] multiplied by the then-current multiplier and advances the stage by the same rule. Return the minimum total time to move everyone to the destination, or -1 if impossible.
Source: Minimum Time to Transport All Individuals on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
n = 1, k = 1, m = 2, time = [5], mul = [1.0,1.3]
5.00000
# Example 2
n = 3, k = 2, m = 3, time = [2,5,8], mul = [1.0,1.5,0.75]
14.50000
# Example 3
n = 2, k = 1, m = 2, time = [10,10], mul = [2.0,2.0]
-1.00000
Constraints
Related LeetCode Problems
Practice more problems similar to Minimum Time to Transport All Individuals.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.