class Solution:

    def maxSubArray(self, nums: List[int]) ->int:
        temp, rslt = nums[0], nums[0]
        for num in nums[1:]:
            temp = max(temp + num, num)
            rslt = max(temp, rslt)
        return rslt

139ffb3d3997d57287c12343a24e2178033ebc32
<mask token>

class Solution:
    <mask token>

class Solution:

    def maxSubArray(self, nums: List[int]) ->int:
        temp, rslt = nums[0], nums[0]
        for num in nums[1:]:
            temp = max(temp + num, num)
            rslt = max(temp, rslt)
        return rslt
