Loading...
Compute the Levenshtein (edit) distance between two strings. The edit distance is the minimum number of single-character operations (insertions, deletions, substitutions) needed to transform one string into another.
Input format:
Output: An integer (the edit distance).
kitten sitting
3
Transformations: kitten → sitten (substitute k→s) sitten → sittin (substitute e→i) sittin → sitting (insert g)
Minimum operations: 3