The Levenshtein distance is a string metric for measuring the difference between two sequences. It is calculated as the minimum number of single-character edits (insertions, deletions or substitutions) required to change one word into the other.
For example, the Levenshtein distance between the words ‘kit’ and ‘sit’ is 1, since a single letter needs to be inserted in order to transform ‘kit’ into ‘sit’.