72 Edit Distance
72. Edit Distance
1. Question
Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)
You have the following 3 operations permitted on a word:
a) Insert a character b) Delete a character c) Replace a character
2. Implementation
(1) DP
3. Time & Space Complexity
DP: 时间复杂度O(mn), 空间复杂度O(mn)
Last updated