Some testcases dint pass

Hi!
You are printing the string in lexicographical order, that’s not the case her.
You have to print the string in the order it was in the input string.
Eg: For bbaa: print b2a2, not a2b2