While we assessiing cSum[-1] index

At first e=we ae accessing cSum[-1] in code how does that work for all test cases. Line no 32 in cde while we are calculating cs(current sum )

https://ide.codingblocks.com/s/323209 I forgot to add code link

Hey,it will not work because cSum[-1] will give garbage values and one of the case when it will not work is when whole array is positive
cs = cSum[j]-i>=1?cSum[i-1]:0; Replace that statement by this to get the right results.