Subset sum easy

sir i wrote the code for this question and also it is giiving correct answer. but it is not passing the test cases.

please somebody help me and tell me what am i doing wrong???

the code link is -

Hey @pushkar24sharma
1)Take input as integer array and solve for it ,all numbers are not single digit (-10^5 ≤ A[i] ≤ 10^5)
2)Your code is always going to print YES because you are taking empty subset into account.For that you have to add extra condition in base case

if(j==0) return ;

1 Like

@Kartikkhariwal1 thank u sir got it

1 Like

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.

1 Like