add solution for edit distance.