```
class Solution(object):
def maxSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
result, sum_v = nums[0], 0
for i, v in enumerate(nums):
sum_v += v
if result < sum_v: result = sum_v
if sum_v < 0: sum_v = 0
return result
```