it is working fine with custom input but not with test cases
Subset Sum Easy Problem
@vipin.kumar
The problem is that you are using a static variable in your function so your code will create problems while working across multiple testcases.
Try this,
Input :
3
4
1 2 2 3
4
1 -2 2 3
4
1 2 2 3
Expected Output :
No
Yes
No
Your Output ;
No
Yes
Yes
@tarunluthra i have modified the code and your above discussed code is working fine still it is showing wrong answer in other test case and how can i start debug my code myself?
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.