Not Passing the second Case

My code is not passing the second case

@jhaabhinav16 you have don’t. have to count total occurrence in whole string of a character you just have to count the consecutive ones for eg :
aabbaaccbb
output should be : a2b2a2c2b2
Your output = a4b4c2.

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.