When calculating the sum between i and j using current sum we are using currsum=cs[j]-cs[i-1] but when i=0 cs[i-1] will become cs[-1]. So is it alowed?
While calculating current sum between i and j
u can treat i=0 as a special condition where u don’t subtract cs[i-1] term
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.