class Solution:
    # @param {integer[]} nums
    # @return {integer}
    def maxSubArray(self, nums):
        length=len(nums)
        if length<1:
            return
        maxx=res=nums[0]
        for i in range(1,length):
            maxx=max(maxx+nums[i],nums[i])
            res=max(res,maxx)
        return res
c43a797e4259ef913620f047dc6b2eef24d75790
<mask token>

class Solution:
    <mask token>

class Solution:

    def maxSubArray(self, nums):
        length = len(nums)
        if length < 1:
            return
        maxx = res = nums[0]
        for i in range(1, length):
            maxx = max(maxx + nums[i], nums[i])
            res = max(res, maxx)
        return res

class Solution:
    # @param {integer[]} nums
    # @return {integer}
    def maxSubArray(self, nums):
        length=len(nums)
        if length<1:
            return
        maxx=res=nums[0]
        for i in range(1,length):
            maxx=max(maxx+nums[i],nums[i])
            res=max(res,maxx)
        return res