Sum it up..... . . . . . . .

how to approach this question/

Hey @CODER_JATIN
1)First sort ur given input array (because then only we can generate lexicographical order)
then generate all subsets recursively ,

2)Then in base case of ur recursive code check if sum of the generated subset is equal to target or not.
3)If it is then insert that subset(as a vector) 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

okay okay . . . . . . . . . . . .

https://ide.codingblocks.com/s/355398 , bhaiya please help me in line no 23, how do i insert integer array in a set.

You cant you have to use vector

BHAIYA , KYA CHANGES KARU FIR ISME AB.

Solve this using vectors instead of arrays

can’t we make a vector of arrays?

No u can’t
And I never heard of vector of arrays by the way
I think u meant array of vectors

https://ide.codingblocks.com/s/355398 , bhaiya ab dekhna kya issue hai>

@CODER_JATIN
Vector kha use kia h yaar
Bas header daaali h baaki sab toh same hi h

Here refer to this : https://ide.codingblocks.com/s/343093?_ga=2.200176622.1350203873.1600106484-1795954092.1597348154

Hey @CODER_JATIN
If u dont have any other doubt in this then please mark it as resolved :slight_smile:

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.