Subset sum problem

Is this approach work for negative number?? and how to find all subset

@amarendra234 hey ,yes ye include exclude wali approach dono cases pr lg jayegi positive as well as negative.

and what about printing the all possible subset

@amarendra234 hn tu print ke lie ap bs vector me pudh krte jao at every call and if base case me sum ke equal hogya hmara sum.to print that vector aur hn backtracking lgegi isme agr ap vector me push krrhe ho to recursion puri hone pr pop kr lia kro.

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.