It should give segmentation error i.e. accessing invalid index at i=0 and j=0 bcz of cs[i-1];
Why does it not give Segmentaion Error when i=j=0
Hey, for i=0 cs[i]=array value only
cumlative sum is sum of previous elements,for i=0 there is no previous element so sum is same as value of current element.So we don’t need to do i-1