Skip to content

Commit ad03a8d

Browse files
committed
Create README - LeetHub
1 parent fe531e6 commit ad03a8d

File tree

1 file changed

+41
-0
lines changed
  • 1957-delete-characters-to-make-fancy-string

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<h2><a href="https://leetcode.com/problems/delete-characters-to-make-fancy-string/">1957. Delete Characters to Make Fancy String</a></h2><h3>Easy</h3><hr><div><p>A <strong>fancy string</strong> is a string where no <strong>three</strong> <strong>consecutive</strong> characters are equal.</p>
2+
3+
<p>Given a string <code>s</code>, delete the <strong>minimum</strong> possible number of characters from <code>s</code> to make it <strong>fancy</strong>.</p>
4+
5+
<p>Return <em>the final string after the deletion</em>. It can be shown that the answer will always be <strong>unique</strong>.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<pre><strong>Input:</strong> s = "le<u>e</u>etcode"
11+
<strong>Output:</strong> "leetcode"
12+
<strong>Explanation:</strong>
13+
Remove an 'e' from the first group of 'e's to create "leetcode".
14+
No three consecutive characters are equal, so return "leetcode".
15+
</pre>
16+
17+
<p><strong class="example">Example 2:</strong></p>
18+
19+
<pre><strong>Input:</strong> s = "<u>a</u>aab<u>aa</u>aa"
20+
<strong>Output:</strong> "aabaa"
21+
<strong>Explanation:</strong>
22+
Remove an 'a' from the first group of 'a's to create "aabaaaa".
23+
Remove two 'a's from the second group of 'a's to create "aabaa".
24+
No three consecutive characters are equal, so return "aabaa".
25+
</pre>
26+
27+
<p><strong class="example">Example 3:</strong></p>
28+
29+
<pre><strong>Input:</strong> s = "aab"
30+
<strong>Output:</strong> "aab"
31+
<strong>Explanation:</strong> No three consecutive characters are equal, so return "aab".
32+
</pre>
33+
34+
<p>&nbsp;</p>
35+
<p><strong>Constraints:</strong></p>
36+
37+
<ul>
38+
<li><code>1 &lt;= s.length &lt;= 10<sup>5</sup></code></li>
39+
<li><code>s</code> consists only of lowercase English letters.</li>
40+
</ul>
41+
</div>

0 commit comments

Comments
 (0)