i am not getting the approach to solve this… can anyone tell me the logic or provide the pseudo code
Sum it up backtracking
Hey, to solve this problem you can produce all the possible subsets of the array and check if the sum of subset if equal to given target sum, also you can use map for duplicate combinations.
i have not studied map till now… can i do without it?
@chaman9
you can store all the combinations in a vector, and then sort the vector and iterate on the combinations to remove the duplicates
ok i will try this thanks
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.