Lcs with 3 strings


why is this code not working …plz correct it …

Plz reply at earliest…

@S19LPPP0202
Why are you moving two coordinates at the same time in line no. 15. It should be return max(lcs(a,b,c,n-1,m,i),max(lcs(a,b,c,n,m,i-1),lcs(a,b,c,n,m-1,i)));
Also use memoization technique otherwise your code will give TLE.

ok how will we print it in this case if we want to print the lcs in 3 strings …provide the code

reply at the earliest…

@S19LPPP0202
Read this https://stackoverflow.com/questions/5057243/longest-common-subsequence-of-3-strings/56115854

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.