String compression problem


my code is getting compiled but not getting any output
please correct the code

@Megha2468 two things, keep a check on i and j that they are not greater then the string length. Second thing the count can be greater than 9, so you cannot directly store it in the out array like a character.
Also you are storing count in out array, without converting it to a number, so it will be treated as ASCII 0-9 value and character with that ascii number will be stored.
An easier approach will be to take the count of character as soon as you encounter a different character, print the character and the current count, then reset the count and count the new character.
If this resolves your doubt mark it as resolved.

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.