omko 25 Newbie Poster

No problem, I also didn't get the idea when I heard about it

let's take for example this array ( [1,-2,3,-4])
what's the consecutive subsets ( subarrays ) which we can derive from it, and their sums

[1] = 1
[1,-2] = -1
[1,-2,3] = 2
[1,-2,3,-4] = 2-
[-2] = -2
[-2,3] = 1
..
[3] = 3
[3,-4] = -1

[-4]

so, the algorithm must return the subarray [3] which has the biggest sum which is 3

more examples ?

Ancient Dragon commented: great explaination :) +25