```
class Solution(object):
def maxSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums:
return None
dp = [i for i in nums]
for i in range(1, len(nums)):
dp[i] = max(dp[i], dp[i - 1] + nums[i])
return max(dp)
```