Skip to content

Commit 6c1a705

Browse files
committed
Create README - LeetHub
1 parent 2816d5e commit 6c1a705

File tree

1 file changed

+25
-0
lines changed
  • minimum-ascii-delete-sum-for-two-strings

1 file changed

+25
-0
lines changed

Diff for: minimum-ascii-delete-sum-for-two-strings/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<h2>712. Minimum ASCII Delete Sum for Two Strings</h2><h3>Medium</h3><hr><div><p>Given two strings <code>s1, s2</code>, find the lowest ASCII sum of deleted characters to make two strings equal.</p>
2+
3+
<p><b>Example 1:</b><br>
4+
</p><pre><b>Input:</b> s1 = "sea", s2 = "eat"
5+
<b>Output:</b> 231
6+
<b>Explanation:</b> Deleting "s" from "sea" adds the ASCII value of "s" (115) to the sum.
7+
Deleting "t" from "eat" adds 116 to the sum.
8+
At the end, both strings are equal, and 115 + 116 = 231 is the minimum sum possible to achieve this.
9+
</pre>
10+
<p></p>
11+
12+
<p><b>Example 2:</b><br>
13+
</p><pre><b>Input:</b> s1 = "delete", s2 = "leet"
14+
<b>Output:</b> 403
15+
<b>Explanation:</b> Deleting "dee" from "delete" to turn the string into "let",
16+
adds 100[d]+101[e]+101[e] to the sum. Deleting "e" from "leet" adds 101[e] to the sum.
17+
At the end, both strings are equal to "let", and the answer is 100+101+101+101 = 403.
18+
If instead we turned both strings into "lee" or "eet", we would get answers of 433 or 417, which are higher.
19+
</pre>
20+
<p></p>
21+
22+
<p><b>Note:</b>
23+
</p><li><code>0 &lt; s1.length, s2.length &lt;= 1000</code>.</li>
24+
<li>All elements of each string will have an ASCII value in <code>[97, 122]</code>.</li>
25+
<p></p></div>

0 commit comments

Comments
 (0)