when to print ’ No’ in this
Subset problem challenge
int sum=0;
//base case
if(i==n){
if(sum==0){
cout<<"Yes";
return 0;
}
every time inside function sum will be intialised with 0 and if i==n
then always sum=0 hence always print “Yes”
your approach is not correct
Correct Approach
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.