Solve edit distance problem
Solve edit distance problem using bottom up optimization