书法字典:https://www.shufadict.com

2009年6月9日

Maximum subsequence sum

摘要: This is a very famous problem from programming pealsGiven an array of integers, return the maximum subsequence sum of the array, if the maximus sumless than 0, return 0Example1, 2, -6, 3, -2, 4, -1, 3... 阅读全文

posted @ 2009-06-09 17:08 翰墨小生 阅读(409) 评论(0) 推荐(0) 编辑

Consecutive sequence with sum 0

摘要: You are given an integer array which contains positive integers, zero and negetive integerscount how many consecutive sequences in this array make a sum of 0.exmapleint[] a = {4, -1, 2, 1, -2, -1, 5, ... 阅读全文

posted @ 2009-06-09 16:26 翰墨小生 阅读(391) 评论(0) 推荐(0) 编辑

导航

书法字典:https://www.shufadict.com