I am not able to resolve the error

Hi @kashishsoni,
I have corrected one major bug that was you were checking for uppercase index also which made your array go out of bound . So here is corrected code but your code still does not work for cases such as aaabbbaaa … for this case your code will give output a6b3 but the correct output should be a3b3a3.
here is the link of your code

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.