The question is 459C.
I have understood the logic behind it. But, in order to generate the possible permutations, I am using DFS.
It gives a WA on test 7, saying that my code prints ":". But, I am not printing ":" anywhere in my code.
Any help would be really appreciated.