My sample test cases got passed but it is showing wrong answer.Here’s my code
#include<bits/stdc++.h>
using namespace std;
int subsetSum(int arr[],int i,int n,int sum){
if((i==n)){
if((sum>0))
return 0;
else{
return 1;
}
}
return subsetSum(arr,i+1,n,sum);
return subsetSum(arr,i+1,n,sum+arr[i]);
}
int main() {
int t;
cin>>t;
int n;
while(t–){
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int flg=0;
if(subsetSum(arr,0,n,0)){
cout<<"Yes\n";
}
else{
cout<<"No\n";
}
}
return 0;
}