Wrong Answer on submit

please tell me how I can avoid empty subset and why my code is giving wrong answer on all test cases

my code:- http://bit.do/subset-sum-easy

To avoid empty subset problem, take another boolean parameter taken which is initially set to false, whenever you take an element pass true for taken, otherwise pass taken as it is. Finally you can see whether you considered atleast one element if taken is true.

I am still getting wrong answer, please review my code : - http://bit.do/subset-sum-easy

Your code is fine, just put endl whenever outputting the result!

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.