Displaying wrong answer for test cases

my code is working for sample test case but displaying wrong answer in other testcases.

Hey @pragyachoudhary1111

The error in your code is that it is not displaying the permutations in a sorted order, while it’s mentioned in the question that you need to display them in a sorted order, so the solution can be that, instead of printing the permutation in the base case, you push it into the vector, and at the end, sort the vector and print it.