Maximum Subarray sum 2

this line :- currentSum =cumSum[j] - cumSum[i-1];
at i=0 cumSum[0-1]=cumSum[-1] which is a error