Code in video if i=0

if i=0 i don’t think it is currentsum[j]-currentsum[j-1], it should be currentsum[j] if i=0;

Hi @Yerragudi-Reddy-1333375683465919
You’re right.
currentSum = cumSum[j]-cumSum[i-1],
but when i=0, it has to be handled with an if-else condition, so yeah if i = 0,
currentSum= cumSum[j]

1 Like