连续子数组的最大和

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

class Solution:
    def FindGreatestSumOfSubArray(self, array):
        if not array:
            return 0
        rest = []
        for i in range(len(array)):
            sum = array[i]
            rest.append(sum)
            for j in range(i+1,len(array)):
                sum += array[j]
                rest.append(sum)
        rest.sort()
        return rest[-1]