class Solution:
def FindGreatestSumOfSubArray(self, array):
# write code here
max = None
tmp = 0
for i in array:
if max == None:
max = i
if tmp + i < i:
tmp = i
else:
tmp = tmp+i
if max < tmp:
max = tmp
return max
网友评论