Doubt about the condition in calculation of currentsum when i=0

Don’t you think there will be an error in our output if i=0 when calculating current sum since the argument for cs[i-1] will yield cs[-1].

@HarmanHps can you tell me which line is your doubt in? or the time instance from the video?

@HarmanHps if you are referring to the formula used, csum[i] = csum[i-1] + a[i] then yes, we have to start the for loop from i = 1 and put value of csum[0] = a[0] prior to running the for loop.

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.