Sir why is this code failing the testcases

sir why is this code failing the testcases

code is saying run time error why??

Array declarations of space >=10^7 give runtime errors. For this question, do one simple thing. First find the length of simple LCS of the two strings, without considering any k factor. Then add k to it and compare it with the lengths of the strings. Final answer can’t be greater than length of any string, so if its greater, update it to the length of smallest string. And display the answer.

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.