Finds the longest subsequence present in both strings in the same relative order.
The Longest Common Subsequence (LCS) problem is to find the longest subsequence common to two sequences. This algorithm uses a 2D table to store the lengths of LCS of substrings and builds the solution in a bottom-up manner.