How to take care of empty sets in this question with my approach

#include
using namespace std;

bool subset_sum(int a[],int n){
if(n==0){
return false;
}
if(n==1){
if(a[0]==0){
return true;
}
return false;
}
bool small_ans=(a+1,n-1);
if(small_ans){
return true;
}
else{
if(small_ans+a[0]==0){
return true;
}
return false;
}
}

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

hello @eesha

ur approach is little bit wrong.
a)
ur function is returning true or false so u cannot use it as a sum.
pass a sum variable, when u inculde any element then add its value to the sum variable
b)
to keep track of empty subset, pass a count variable.
when u include any array eleement then increment its count value by 1.
and then in base case check for two condtion if count > 0 and sum==0

check this->

thanks .