Class Solution
java.lang.Object
g0501_0600.s0583_delete_operation_for_two_strings.Solution
583 - Delete Operation for Two Strings.<p>Medium</p>
<p>Given two strings <code>word1</code> and <code>word2</code>, return <em>the minimum number of <strong>steps</strong> required to make</em> <code>word1</code> <em>and</em> <code>word2</code> <em>the same</em>.</p>
<p>In one <strong>step</strong> , you can delete exactly one character in either string.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> word1 = “sea”, word2 = “eat”</p>
<p><strong>Output:</strong> 2</p>
<p><strong>Explanation:</strong> You need one step to make “sea” to “ea” and another step to make “eat” to “ea”.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> word1 = “leetcode”, word2 = “etco”</p>
<p><strong>Output:</strong> 4</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= word1.length, word2.length <= 500</code></li>
<li><code>word1</code> and <code>word2</code> consist of only lowercase English letters.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
minDistance
-