LCS with 3 Strings

https://ide.codingblocks.com/s/164739
One testcase failing.

I did what’s shown in the hint video but want to know why my approach is giving wrong answer.

Actually I’m in colg rt now
I have marked ur doubt acknowledge
Ur code seems to be correct.
I am not able to find out the test case which is failing ur code currently.
I’ll try it at home.
So just do ur next task. I’ll get back tu u soon.

@dekay
Any update about my solution?

i’m really sorry bro
actually your above code ide link has been modified by you.

so i don’t have ur soln

can u pls resend that code.

i am apologize for my work

@dekay
Modified that link again. Please check.

this is a wrong approach.
you to solve this string using all the 3 str. simultaneously.

there r multiple lcs r possible for the given two strings.
and ur code just finding the max len lcs for the given 2 strings.

e.g
str1: abc12
str2: 12abc
str3: 12xyz

o/p for the lcs of first two string is: abc(len==3)
but when take the lcs of ( abc and 12xyz)
it will give 0

but the o/p should be 2.

hope this will help u
pls rate my work so that i can improv myself.
again sorry for the late reply

1 Like

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.