Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.
You have the following three operations permitted on a word:
Input: horse ros Output: 3
Input: intention execution Output: 5
Input: abc abc Output: 0
Your program must print a single integer representing the minimum edit distance so it can be compared with the expected output.
No submissions yet.
Discuss dynamic programming table construction, base cases, and time–space optimization.