Need help in approach of sumitup problem

I am not able to think further. Need help in solving this question

hello @prerna_gupta31

ur code logic is partially correct.
this is the approach->
first sort ur given input array (because then only we can generate lexicographical order)
then generate all subsets recursively ,
then in base case of ur recursive code check if sum of the generated subset is equal to target or not.
if it is then insert that subset in a set (set because it will remove duplicate subsets and it will keep all of them in sorted order)

at last print ur set

I tried implementing the code according to your instructions… yet I am not able to complete it. can you please help me with this https://ide.codingblocks.com/s/342992

how do we create a set of arrays?

use vector in place of array because size of subset in not fixed.

check this->

Thanks a lot! I got to learn a lot from your code