STRING COMPRESSION 2 Test Cases Failing

Two test cases failing . Please help .
https://ide.codingblocks.com/s/62218

Hi mohit, you have to only consider consecutive characters…
for input abcda the output will be a1b1c1d1a1 but your code gives output a2b1c1d1

1 Like

Thankyou so much! Resolved .
https://ide.codingblocks.com/s/62235
Changed code.