2 Test Cases Not Passing


Is the code that i have summited please help 2 test cases are not passing.

You have assumed that if a character occurs it will occur at only one position, but that is not the case.
Eg : aba
here answer should be a1b1a1.
To solve this, you need to process the string maintaining the count of current char, and output the cout and char as soon as new char is encountered.