Subset Sum easy problem

My output is correct but showing wrong answer on submission.
Please tell whats wrong in my code.

hi @ujj1804_1156aee80205d0bf
corrected code -->


Its passing all test cases now…

1 Like

Thank you very much sir for such a great help, kindly tell that why in the statement
if(sum==0 && output[i].size() != 0) , you have used output[i].size() != 0 , what is the use of it , does it mean that we dont want to check null subset ?

1 Like

hi @ujj1804_1156aee80205d0bf
Yes if u consider null set then always sum will come to 0… hence u have to ignore null subsets…

Thank you very much sir , doubt is clear now.

1 Like

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.