Find the longest common subsequence of two sequences