please check what is wrong with my code why test cases are not passing
Test cases are not passing
@Gaurav_dev
there is mistake in line no 42, it should be cout<<βNoβ<<endl; β<<β not β<β
Also at the end at end of iszero() function write return false;
please check my code again on the provided link β¦it is return false at the end of iszero function and it is cout<<βNoβ<<endl; which is perfect according to the problem statement
@Gaurav_dev
Your logic is not correct. Why are you just checking only two index i,j for sum to be zero?
Consider this testcase
1
4
-1 -5 4 2
Ans should be βYesβ here because sum of all element will result in zero { (-1) + (-5) + 4 + 2 = 0 } . But your code is giving βNoβ
can you provide the right code by making changes in my code
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.