Skip to content

Commit ac7e990

Browse files
committed
Create README - LeetHub
1 parent a2e5d00 commit ac7e990

File tree

1 file changed

+30
-0
lines changed
  • 1128-remove-all-adjacent-duplicates-in-string

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<h2><a href="https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string">1128. Remove All Adjacent Duplicates In String</a></h2><h3>Easy</h3><hr><p>You are given a string <code>s</code> consisting of lowercase English letters. A <strong>duplicate removal</strong> consists of choosing two <strong>adjacent</strong> and <strong>equal</strong> letters and removing them.</p>
2+
3+
<p>We repeatedly make <strong>duplicate removals</strong> on <code>s</code> until we no longer can.</p>
4+
5+
<p>Return <em>the final string after all such duplicate removals have been made</em>. It can be proven that the answer is <strong>unique</strong>.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<pre>
11+
<strong>Input:</strong> s = &quot;abbaca&quot;
12+
<strong>Output:</strong> &quot;ca&quot;
13+
<strong>Explanation:</strong>
14+
For example, in &quot;abbaca&quot; we could remove &quot;bb&quot; since the letters are adjacent and equal, and this is the only possible move. The result of this move is that the string is &quot;aaca&quot;, of which only &quot;aa&quot; is possible, so the final string is &quot;ca&quot;.
15+
</pre>
16+
17+
<p><strong class="example">Example 2:</strong></p>
18+
19+
<pre>
20+
<strong>Input:</strong> s = &quot;azxxzy&quot;
21+
<strong>Output:</strong> &quot;ay&quot;
22+
</pre>
23+
24+
<p>&nbsp;</p>
25+
<p><strong>Constraints:</strong></p>
26+
27+
<ul>
28+
<li><code>1 &lt;= s.length &lt;= 10<sup>5</sup></code></li>
29+
<li><code>s</code> consists of lowercase English letters.</li>
30+
</ul>

0 commit comments

Comments
 (0)