There's something wrong with sir's code

In the iterations where i == 0.
Statement in which we find current sum index of cum_sum[i-1] == -1 which will give a garbage value.
Please correct it…

yes, its was a mistake and would be corrected later.

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.