Equalize String 2Ddp

I have got runtime error in testcase 2,3,4,5.
Can you plz resolve it or even give me the input of testcase3,4 or any custom input to see my error.
While I have been submitted successfully this question at CSES problems sheet.

@imadarshanand Please ask this doubt under the question where you submitted solution or if you submitted it on hackerblocks or somewhere else then give that link