编辑距离Edit Distance 非常典型的DP类型题目

https://leetcode.com/problems/edit-distance/?tab=Description

真的非常好,也非常典型。

https://discuss.leetcode.com/topic/17639/20ms-detailed-explained-c-solutions-o-n-space

dp[i][0] = i;
dp[0][j] = j;
dp[i][j] = dp[i - 1][j - 1], if word1[i - 1] = word2[j - 1];
dp[i][j] = min(dp[i - 1][j - 1] + 1, dp[i - 1][j] + 1, dp[i][j - 1] + 1), otherwise.
原文地址:https://www.cnblogs.com/charlesblc/p/6443262.html