leetcode583】的更多相关文章

Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one character in either string. Example 1: Input: "sea", "eat" Output: 2 Explanation: You ne…
public class Solution { public int MinDistance(string word1, string word2) { , word2.Length + ]; ; i <= word1.Length; i++) { ; j <= word2.Length; j++) { || j == ) dp[i, j] = ; ] == word2[j - ]) ? dp[i - , j - ] + : Math.Max(dp[i - , j], dp[i, j - ])…