I binary-search the maximum running time T. For a candidate T I check if the total available minutes (summing min(b, T) for every battery b) is at least n * T — because each computer needs T minutes and a single battery can contribute at most T minutes toward a given computer. If the check passes, T is feasible and I try larger values; otherwise I try smaller ones.
class Solution:
def maxRunTime(self, n: int, batteries: List[int]) -> int:
