Compute the edit distance between two strings