Doubt doubt doubt

There is problem in Prateek bhaiyas programme…if i takes 5 inputs in array…{1,2,3,4,5}…anwer i am getting is 14 and not 15.
Also if the first loop starts from i =0 …then cumsum = cumsum[j] - cumsum[i-1]…and cumsum[i-1] becomes cumsum[-1].

hello @parth_tyagi

pls share ur implementation with me.

yeah right.
u need to handle i==0 case seprately

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.