Simple solution to finding the Minimum Time to repair cars
IntuitionTo solve this problem we need to break our problem into parts.
How many cars can a mechanic fix in fixed time?
What algorthim should we use to solve ou
# Intuition
To solve this problem we need to break our problem into parts. 
How many cars can a mechanic fix in fixed time?
What algorthim should we use to solve our problem?

# Approach
Instead of finding minimum time we start by finding how many cars can be fixed in some 'x' time say.
So our formula becomes:
n=⌊ sqrt(T/r) ⌋

Instead of brute force, binary search helps find the minimum time T where total cars repaired ≥ required cars.

# Code Explaination:
```
def numCarsFixed(minutes: int) -> int:
    total_cars = 0
    for rank in ranks:
        total_cars += math.isqrt(minutes // rank)
    return total_cars
```

This function calculates how many cars can be repaired within a given time minutes. We go one by one iteration until we get the shortest time using this function.


```
max_time = min(ranks) * cars**2  
time_range = range(max_time) 
min_time = bisect.bisect_left(time_range, cars, key=numCarsFixed)  
```
Main Components:
**max_time** → The upper bound for time.
**time_range** → The range of possible times.
**bisect_left** → Performs binary search to find the minimum time.

Tries different time values starting from 0 up to min(ranks) * cars**2.

***Note:***
bisect is a module in Python, and bisect_left is a function inside this module.

**bisect_left** is a function that performs binary search to find the leftmost insertion position of an element in a sorted list.




# Complexity
- Time complexity:
 *O(NlogT)*
 Where T = min(ranks) * cars².

- Space complexity:
	O(1)

# Code
```python3 []
class Solution:
    def repairCars(self, ranks: List[int], cars: int) -> int:
        def numCarsFixed(minutes: int) -> int:
            total_cars = 0
            for rank in ranks:
                total_cars += math.isqrt(minutes // rank)
            return total_cars
        max_time = min(ranks) * cars**2  # Upper bound for time
        time_range = range(max_time)  # Create's a range from 0 to max_time
        min_time = bisect.bisect_left(time_range, cars, key=numCarsFixed)  # Finding minimum valid time
        return min_time
```
['Python3']