Not Passing Test Cases

https://ide.codingblocks.com/s/254646 please help this code is unable to pass the test cases

hey @Siddharth6780

u have written wrong base condition in the code
the base condition will be when u have reached the end
only then check if the sum == 0