My two test cases are not passed


This is my code

Hello @Gunit,

  1. Read the constraints properly:
    1 < = length of String < = 1000
    Problem:
    Size of your array.

  2. Your code is failing for test cases like:
    aaba
    Expected Output:
    a2b1a1
    Your Output:
    a3b1a3

Better way to initialize array with all 0s:
int arr[100]={0};

Hope, this would help.
Give a like if you are satisfied.

can you please send the code I am unable to figure out

Still not working https://ide.codingblocks.com/s/228365

Hello @Gunit,

You can refer to this code:

Let me know if you still face any issue.

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.