Only Two Test Cases Are Passing

sir can you please tell why is this code not passing all the test cases

Hello @varshita_04 this code doesn’t mean that you have to count the number of occurences of alphabet and print the total characters rather you have to print the number of continous same character.
for this test case:
aaabsdfga
correct output is:
a3b1s1d1f1g1a1
Here for your reference i am attaching the code:


if you have any doubt you can ask here:
Happy Learning!!

Ok sir. Got it resolved. Thank You.

@varshita_04 you can mark this doubt as resolved.
Happy Learning!!

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.