Problem in Code

what is wrong in the code? getting wrong answer.
is the approach correct?

In this question, you do not have to consider the duplicate combinations. For that you have to maintain a check in the recursive function. Also you will get the sorted combination if you first sort the array and then send it to the recursive function.
Refer this

i am unable to understand this solution. Please help

https://ide.codingblocks.com/s/339712 still fails one test case…please help

Your code does not give correct output for the given sample test case. Please check for that.
One thing you can do here is rather than printing( inside base case ), insert the array into a ‘ set ’. The set can be like set . Then at the end print all the elements from the set.

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.