I suggest to check out the following post first: Edit distance refer to minimum number of moves to make two strings equal. The Levenshtein distance is a string metric for measuring difference between two sequences. Informally, the Levenshtein distance between two words is the minimum number of single-character edits […]

Algorithms – Dynamic Programming – Edit distance (Levenshtein)