📅  最后修改于: 2022-03-11 14:46:36.451000             🧑  作者: Mango
def kadane(inputArray):
maxSum = float("-inf")
curSum = 0
for x in inputArray:
curSum = max(0, curSum + x)
maxSum = max(maxSum, curSum)
return maxSum