Not able to pass one test case
Please check code for LCS with 3 strings
hello @sahilkhan2312000131
this logic will fail when first 2 strings will have more than one lcs.
for ex->
abc
acb
abd
here lcs of first 2 strings can be (ab , ac)
if u pick ab and take its lcs with abd then resultant lcs will be of length 2.
if u pick ac and take its lcs with abd then resultant lcs will be of length 1.
clearly ur will fail for above such cases.
use 3d dp to solve this problem
check now->
check now->
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.