I am not able to pass all the test cases

Hey @akash_281, what issue your are getting while submitting it?

Sample Output

abc
acb
bac
bca

My output:
acb
abc
bca
bac

Not getting the right order

Hey friend, the order you are getting is of course not desired one. But the implementation is absolutely correct. There’s further more thing to do that is store your s string in a vector v then sort it using sort(v.begin(),v.end()) then you will see the vector will be having result in an desired output. You can ask again if you any doubt left :slight_smile:

Code for reference : https://ide.codingblocks.com/s/345445 :slight_smile:

@mr.encoder
Thanks will try that.