2. Largest Common Subsequence #

Created Monday 16 March 2020

LCS.cpp

In LCS we use the basic methodology of string recursion. This works like a charm because at the end of the day. We can see only an atomic part of the string.

Either the letter is present or it is not.

If
return 1 + LCS(a.substring(1), b.substr()) else return max(LCS(a.substr(1), b), LCS(a, b.substr(1))