At first I didnt read the question so i did it with set and it worked but now Im trying to do it without sets and its not working for 5 to 6 test cases
Git Gist
At first I didnt read the question so i did it with set and it worked but now Im trying to do it without sets and its not working for 5 to 6 test cases
Git Gist
input abc
your output
abc
acb
bac
bca
cba
cab
correct output
abc
acb
bac
bca
cab
cba