Not able to complete the test cases

i’ve corrected and optimised the solution many times but still i’m unable to fulfil the test cases conditions please help me out
link to the code is

@pranav_sharma
Your approach is wrong. You are assuming that the output needs to in sorted order of letters or that you will not be getting same character later on the series. You are simply computing the frequency of each character and printing it. That is not what the problem is about.
Input :
aabbba

Expected Output :
a2b3a1

Your Output :
a3b3

You need to change your approach as this is not what the problem statement demands you to do.

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.