during the first execution of
currSum = cumSum[j] - cumSum[i-1]
it becomes currsum = cumsum[0] - cumsum[0-1]
how is that possible?
please correct me !
during the first execution of
currSum = cumSum[j] - cumSum[i-1]
it becomes currsum = cumsum[0] - cumsum[0-1]
how is that possible?
please correct me !
@khushi20
Yes 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] ;
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.