find the edit distance of two strings