Skip to content

Practice Minimum Time to Repair Cars

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#2594
LeetCode Problem

Minimum Time to Repair Cars

Problem Statement

Mechanic i has rank ranks[i]. A mechanic of rank r needs r * n^2 minutes to repair n cars. Mechanics work simultaneously. Return the least time in which they can collectively repair the given number cars.

Source: Minimum Time to Repair Cars on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
ranks = [4,2,3,1], cars = 10
Output
16

# Example 2

Input
ranks = [5,1,8], cars = 6
Output
16

Constraints

1 <= ranks.length <= 10^5
1 <= ranks[i] <= 100
1 <= cars <= 10^6

Related LeetCode Problems

Practice more problems similar to Minimum Time to Repair Cars.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.