Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2 using insert, delete, and replace. This is the classic two-dimensional tabulation DP problem.
word1 and word2 = strings
minimum edit distance
Example 1:
Input:
word1 = "horse" word2 = "ros"
Output:
3
Explanation:
horse -> rorse -> rose -> ros takes 3 edits.
Example 2:
Input:
word1 = "intention" word2 = "execution"
Output:
5
Explanation:
This is the classic example with edit distance 5.