Strings compression

I am getting one wrong answer it is working fine on eclipse

save your code on ide.codingblocks.com and share the link here

consider a case like this abaa your code will give a3ba3…this is because you are searching for a letter a in the entire string and then incrementing your count…but you only need to count consecutive characters…moreover it is a random case generated by me not a tc…

sir so how can i include that case
it is showing 75 score it means that i am pass

see a code needs to pass all the tc…your code is not passing all the tc due to the issue mentioned above

when you are counting for a character start your idx of counting from one position ahead of that character…and stop your counting if you find a character which does not match your current character…

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.