Longest Common Subsequence and Longest Common Prefix