レーベンシュタイン距離
This implementation is very inefficient because it recomputes the Levenshtein distance of the same substrings many times.