Levenshtein distance
// for all i and j, d[i,j] will hold the Levenshtein distance between