Subset sum easy- wrong answer for both test case

i got the desired sample output with the sample input but after submitting both of my testcase are wrong , help me solve this problem

Hello,

This statement will always return true, as you are passing sum as 0 in the loop.
int sum = 1;
if (isSubsetSum(set, n, sum) == true)
ans[t]=true; // why don’t you print “yes” here rather making an array?

BTW, your function is not calculating the sum of subsets.

Your logic is wrong.
Try hard to correct it.

Hope, this would help.

You have not replied to it since 4 days.
if you still have any doubt regarding the same, let me know.
Else, mark it as resolved.

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.