1953. Maximum Number of Weeks for Which You Can Work

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1953

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