编辑距离
一道有名的DP面试题(https://leetcode.cn/problems/edit-distance/solutions/188223/bian-ji-ju-chi-by-leetcode-solution/)
给你两个单词 word1 和 word2, 请返回将 word1 转换成 word2 所使用的最少操作数
你可以对一个单词进行如下三种操作:
1. 插入一个字符
2. 删除一个字符
3. 替换一个字符
一道有名的DP面试题(https://leetcode.cn/problems/edit-distance/solutions/188223/bian-ji-ju-chi-by-leetcode-solution/)
给你两个单词 word1 和 word2, 请返回将 word1 转换成 word2 所使用的最少操作数
你可以对一个单词进行如下三种操作:
1. 插入一个字符
2. 删除一个字符
3. 替换一个字符