Given an array a of numbers (which could be positive or negative), indexed from 0 to n-1, find integers i and j so as to maximize a[i] + .... + a[j]. For example, if n = 13 and the array elements are: -2 3 5 -1 2 -8 -9 1 6 -2 5 -9 3 then the solution is i = 7, j = 10, and the maximum sum is 1+6-2+5 = 10.