Need help in the printing order , 3 Test cases are not passing due to it

https://ide.codingblocks.com/s/201311-- Code link

I have made the recursive program but my priniting order works for first letter of string (it compares them lexico wise)

example sample input is cab ;
my output is
acb
abc
bac
bca where as desired is
abc
acb
bac
bca

@anmol1911
hello Anmol,
a)store all ur valid strings in vector .
b) sort the vector in lexicographical order
c) then print it

Hi,
I have not studied vectors yet , Is there any other approach besides it
or another way to sort the strings

@anmol1911
use array

Hi,I am not able to find any way to use array as a storage medium and sort all the strings in it too…
Can you please show a coded implementation

@anmol1911

Thanks for the code, I was earlier implementing a 2d char array , which didnt solve up, guess array of strings is a better choice :smile: