ranks array to a long array to prevent integer overflow.ranks array.si (start index) as 0 and ei (end index) as a large number (e.g., Long.MAX_VALUE).mid as the average of si and ei.
b. Use the helper function to check if it is possible to repair all cars in mid time.
c. If possible, update the result time and move ei to mid - 1.
d. If not possible, move si to mid + 1.si is greater than ei.