Not Passing One Test Case

Take as input S, a string. Write a function that does basic string compression. Print the value returned. E.g. for input “aaabbccds” print out a3b2c2ds.
https://ide.codingblocks.com/s/609557

Hi Girish,
so what u are doing wrong is initially storing all frequencies and then just printing them…
for example
consider the input bbbaaa
ur o/p --> a3b3
expected o/p --> b3a3
u can refer to my code https://ide.codingblocks.com/s/609664

1 Like

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.