K-Ordered LCS PROBLEM

Can it be implemented through iterative approach
i am trying but i am not getting right answer .

Hi @Mohammad_Ravil,
You can use a DP approach to avoid WA or TLE. You can start by visualizing a 3D array approach.
Take string1 as m and string2 as n and construct a 2D array (m x n). Now, let string3 is of length k. Hence, see this as k (mxn) 2D arrays. Hence we can make a 3D array as m x n x k. I hope you get my point.

Ping me for any further doubts.

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.