String compression - 2 cases failed

My solution: https://ide.codingblocks.com/s/406191

Question: https://online.codingblocks.com/app/player/178555/content/173728/4744/code-challenge

Test case 1,2 failed - wrong answer. 0,3 passed

Hello @mohaktrivedi you cant sort the string or character array like you have to compress the string of continuous same elements only :
i.e if the input is aaabbcdsa
then the ouput should be: a3b2c1d1s1a1
Happy Learning!!

@tusharaggarwal272 Oh! I misinterpreted the problem. Thanks for pointing out my mistake.

@mohaktrivedi you can mark this as resolved.
Happy Learning!!