Recursion permutation

https://ide.codingblocks.com/s/50962

wrong ans on submitting although it is giving right output for sample case

https://hack.codingblocks.com/contests/c/512/357

You have to print all the permutations in lexicographical order instead of printing it directly.

1 Like

can u plz make a lexicographical fn for me in my code, i m not able to make it.

In line no. 8 where you are printing the string just store it in map/set(ordered), since ordered map/set stores the strings in lexicographical order and then print this map/set atlast.

1 Like