If i give input of array as 1 2 3 4 then i am getting max subarray sum as 9 and subarray as 2, 3, 4.
I think it should be 10 for subarray 1, 2, 3, 4.
Here is my code link:
currentsum=cumsum[j]-cumsum[i-1]; // for i = 0 index become -1 for i-1. I think this is creating a problem.