Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.
Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.
给你一个序列a[1],a[2],a[3]......a[n], 你所要做的就是计算亚序列(我自己的理解,这里根据后面就是从所给全部数中去掉一个剩下的所有数)的最大和。例如给你(6,-1,5,4,-7),这个序列的最大和是(去除最小的数其它数的和) 6 + (-1) + 5 + 4 = 14.