Cum[-1]? why is this not resulting in an error?

at 6:18 …when i=0 and j=0; currentSum = cumSum[0] - cum[-1]
isn’t this erroneous?

cumSum[-1] not cum[-1]

@shaswat.tripathi_da18 Yes you should prevent negative indexes in the array as it may have some unexpected results depending on the compiler. But here it is not causing any error and taking cumSum[-1] as 0. It basically depends on the compiler.

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.