update solution for the question, longest common subsequence