class Solution:
def maxSubArray(self, nums: List[int]) -> int:
if max(nums)<0:
return max(nums)
local_nums,global_nums = 0,0
for i in nums:
local_nums=max (0,local_nums+i)
global_nums=max (local_nums,global_nums)
return global_nums