Subset sum easy

issue regarding submission of code.

it is passing sample testcase but showing wrong answer in both testcases on submitting

@chehakagrawal01
Try this
Input :
1
4
1 2 3 4

Expected Output :
No

Your Output :
Yes

i think it is counting null subset as the subset which has zero sum everytime.

thats why it is always giving yes as output. Am i right?

@chehakagrawal01
That is one reason. But if you look closely , you have not returned anything in your function other than the base case. When you are performing recursion with a function that has a return type , you are supposed to make the recursive calls , store the result obtained from those recursive calls , perform some operation on them if required and then return the final result after doing your work. You have made the recursive calls but never stored or used their results. Hence the result from a child call become useless as they are not returned above in call hierarchy. Try storing the result you obtained from recursive calls and then returning it after doing some work over it (if needed).