Test cases not working why?

i downloaded failed test cases, when i run its giving me correct o/p. But when i submit it says 3rd test case failed.

my code : https://www.codepile.net/pile/LN0JydBm

@premang you are missing the case when the last character is unique and not printing that.
For example let’s say the test case is
abcde
your code gives output as a1b1c1d1
but the output should have had been a1b1c1d1e1.
So add this ‘else if’ statement after the condition where you are checking if(i==len-1 && str[i]==str[i-1])

		else if(i==len-1)
			cout<<str[i]<<"1";

Your code works after this.

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.