1953. Maximum Number of Weeks for Which You Can Work
On This Page
class Solution:
def numberOfWeeks(self, milestones: List[int]) -> int:
mx, s = max(milestones), sum(milestones)
rest = s - mx
return rest * 2 + 1 if mx > rest + 1 else s