1413. Minimum Value to Get Positive Step by Step Sum

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

Содержание

LeetCode problem 1413

class Solution:
    def minStartValue(self, nums: List[int]) -> int:
        s = list(accumulate(nums))
        return 1 if min(s) >= 0 else abs(min(s)) + 1