Edit Distance


Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)

You have the following 3 operations permitted on a word:

  1. Insert a character
  2. Delete a character
  3. Replace a character


Example :
Convert Word1 to Word2
Word1 : “azceg”
Word2 : “abcdef”

Minimum edit distance is 3.
Replace Z with B
Delete D
Replace G with F

Hints and Answer Checklist