Whyyyyy my java code is getting run-time error

this Q. is same as hacker-earth problem named as -“Mancunian and K-Ordered lcs”
and the fact is hacker earth is not showing runtime error

@S18CRX0174 hey apne input sahi dia hai?

ha, bilkul shi dia hai

@S18CRX0174 output to arha hai.Aap qstn link send krdo mein submit krkr xheckkrlunga

https://online.codingblocks.com/app/player/57012/content/117060/5154/code-challenge

@S18CRX0174 this link is not opening,hackerblocks ka link ddedo pls.

https://hack.codingblocks.com/app/practice/1/1353/problem

@S18CRX0174 hey mene thode changeskie hai please check it and ans result variable me store kraya hai,please check:

now i know that there is a problem with backend for java submission because with c++ code having same intution is accepted

@S18CRX0174 ya ,actually woh language pr depend krta hai ,khi me hojata hai khi me nhi,so dont care about that,just focus on logic and optimised soln.