Calculate the longest common subsequence of two string.