left = 1 and right = max(time) * totalTrips.left < right, perform the following steps:
a. Calculate the middle value mid = (left + right) / 2.
b. Initialize a variable trips to store the total number of trips that can be completed in mid time.
c. Iterate over each bus time in the time array and add mid / time[i] to trips.
d. If trips is greater than or equal to totalTrips, set right = mid as the new upper boundary.
e. Otherwise, set left = mid + 1 as the new lower boundary.left as the minimum time required to complete at least totalTrips trips.