Why my all test cases is not getting passed?

As i am taking first character of the string and trying to delete it from the rest part to get the rest of the string,Again one new character used to come at the first position after my deletion

@shubhankar1996.dob1 the output for
aabbaa should be a2b2a2
but your output is a4b2

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.