Edit Distance
Return the minimum number of edits to convert word1 into word2.
Examples
Input: ["horse","ros"]
Output: 3
Input: ["intention","execution"]
Output: 5
Hints
Consider the base cases where one of the strings is empty; the number of edits is simply the length of the other string.
Explore the recurrence relation where characters at the current positions match, allowing you to skip an edit operation.
Optimize space complexity by reducing the DP table to two rows (or a single row) while maintaining correctness.
Related Problems
Edit Distance
Return the minimum number of edits to convert word1 into word2.