code : https://ide.codingblocks.com/s/77412
Test cases are not passing but code gives correct answer for custom input. Couldn’t find the error in the logic, please help
Subset Sum easy- wrong answer
hey Siddharth, consider the following case:
2
4
0 0 0 0
4
1 1 1 1
The expected output is:
Yes
No
Your code’s output:
Yes
Yes
Conclusion: you are getting wrong answer beacuse cnt value is not set to zero if check for next testcase. Just add cnt=0; at line no 36 and all of your testcases will pass