-ve index while loop

We will get CumSum[-1] index at the starting of loops while calculating the

CurrSum = CumSum[j] - CumSum[i-1];

here i will be 0 at stating

Hey @stathe
Yes we have to add one constraint which Sir missed

if(i>=1)
current_sum = cum_sum[j] + cum_sum[i-1];
else
current_sum= cum_sum[j] ;