String compression

what’s wrong in my code???
i think it’s giving correct output for all cases…

hello @sr7.shubhamrai

u have misunderstood the problem, u have compress only consecutive same character.

for example->
aaaabba will be compressed as
a4b2a1

we don’t have to takke all a together then :frowning:

thank you , i understood now

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.