Maximum Running Time of N Computers LeetCode solution in Python
1# Runtime: 1321 ms (Top 44.04%) | Memory: 28.7 MB (Top 24.77%)2class Solution:3def maxRunTime(self, n: int, batteries: List[int]) -> int:4batteries.sort()5total = sum(batteries)6while batteries[-1] > total // n:7n -= 18total -= batteries.pop()9return total // n