K ordered lcs..................doubt

how to see for k ???
not able to think

please tell and also make the changes in my code

hey @hg11110000 this is the 3d dynamic programming question .
could you please explain your logic of doing the code .

i havent done that actually…not able to understand how to adjust for k ??

the above solution i gave is for normal lcs
@tusharaggarwal272

with this question you can learn the concept 3 dimensional programming .
here i am attaching the code please ask if you dont understand anything .