String compression problem

I am unable to pass one test case.
I had tried many sample input it gives the correct output.I am unable to think of the test case which is getting failed.Can you please tell me what is wrong in my code

@adityakumarsingh226
first error size 1000
second check for input 10 times a
i hope its clear if yes dont forget to mark it as resolved :smiley: