edit distance problem