Use top down DP to solve longest common subsequence problem, O(n*m) time and space.