Use top down approach DP to solve edit distance problem, O(n^2) time and space.