Update LCS(Longest Common Subsequence)