2219. Maximum Sum Score of Array

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

Содержание

LeetCode problem 2219

class Solution:
    def maximumSumScore(self, nums: List[int]) -> int:
        s = [0] + list(accumulate(nums))
        return max(max(s[i + 1], s[-1] - s[i]) for i in range(len(nums)))