Why cannot we use lcs here?


#1

why this is giving wrong output .
Approach: ans= abs(A.length()-B.length()) +min(A.length(),B.length())-lcs(A,B) .


#2

geedfk gegjek
correct output is 3(replacing edf with gje in above testcase)
according to you answer is 2(using LCS and getting max difference from both string lengths)
so once check above test case