# Levensthein distance: levenshtein

### 5.3.15 Levensthein distance: levenshtein

The levenshtein command computes the Levenshtein distance between two words, which is the minimum number of single-character edits (insertions, deletions or substitutions) required to change one word into the other.

levenshtein takes two arguments:

- s1, a vector or string.
- s2, a vector or string.

levenshtein returns the minimum number n of edits required to transform s1 into s2.

#### Example.

- Input:
  levenshtein("kitten","sitting")
- Output:

  3