Code seems working fine, but test case not passing
@vmanav In the question it is given that the output must be in sorted order.So instead of printing the output in the base case push the result in a vector. After that sort the vector in the main and then print the vector.
i have made dome chnages as you said but it is still showing a 'run-error’on 2 test case…
Also do we have to find out all the possible permutation or is there any other method to solve this…
LINK - https://ide.codingblocks.com/s/197165
Check now.
Do we have to find out all the possible permutation or is there any other method to solve this…
We have to find out all the possible permuatations and this is the optimal approach.
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.