This is a very famous problem from programming peals
Given an array of integers, return the maximum
subsequence sum of the array, if the maximus sum
less than 0, return 0
Example
1, 2, -6, 3, -2, 4, -1, 3, 2, -4
return 9
3 + -2 + 4 + -1 + 3 + 2 = 9
Code
or more concise
Code
本文转自zdd博客园博客,原文链接:http://www.cnblogs.com/graphics/archive/2009/06/09/1499815.html,如需转载请自行联系原作者