Maximum subsequence sum
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/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.