Longest common subsequence (LCS) is a classic problem of dynamic programming. The problem is to find out the longest subsequence which presents in the two given sequences. A subsequence is a sequence that appears in the same relative order, but not necessarily contiguous.
The solution of LCS is delicate, and the idea can be applied to many other problems. I will walk through these problems in this post.