i am not getting correct answer. please check my code
Lcs with 3 strings
hi nidhi
there will be 6 cases you are considering only 3 cases
int max1=max(dp[i-1][j][k],dp[i][j-1][k]);
int max2=max(dp[i][j][k-1],dp[i-1][j-1][k]);
int max3=max(dp[i-1][j][k-1],dp[i][j-1][k-1]);
dp[i][j][k]=max(max1,max(max2,max3));
these are the 6 cases.
include these in your code
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.