| A | E | B | D | F |
|---|
The Longest Common Subsequence (LCS) problem finds the longest subsequence common to two sequences. Unlike substrings, subsequences don't need to be consecutive elements.
For example, the LCS of "ABCDEF" and "AEBDF" is "ABDF" with length 4.