Not able to pass the test cases

the given example input is giving correct output but not satisfying the test cases…

#include<bits/stdc++.h>
using namespace std;
void ans(int a[],int n,int sum,int i,int *count)
{
if(i==n)
{
if(sum==0)
*count=*count+1;
return;
}
ans(a,n,sum+a[i],i+1,count);
ans(a,n,sum,i+1,count);

}
int main() {
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
int a[n],i;
for(i=0;i<n;i++)
cin>>a[i];
int count=0;
ans(a,n,0,0,&count);
if(count>0)
cout<<“Yes”<<endl;
else
cout<<“No”<<endl;
}
return 0;
}

In your recursive calls, add one variable that will check whether the subset sum is of empty set or not
something like
ans(a,n,sum+a[i],i+1,count, empt+1);
ans(a,n,sum,i+1,count,empt);

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.