Lcs output run error

in dp lcs problem while program gives correct ans in local ide and run error on codingblocks website on submit.

Hey @mddanish
In your for loop in print_lcs function, you are running loop from for(int i=m;i>=0;). This is incorrect.
It should be i > 0. Not i >= 0. Similarly for j.

If your doubt is resolved please mark it as closed.

program run without error after downloading the testcase but run error on submit. result do not change by changing >= to >

SIze of strings can be at max 1000 not 100 so change 100 to 1001 at every place.
Your function to print is incorrect since you’re running it in two nested loops. It should be one loop starting at i=m,n=j while both are >= 0.

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.