レーベンシュタイン距離
The difference from the algorithm for Levenshtein distance is the addition of one recurrence: