Skip to content

Commit 1064fe6

Browse files
committed
Create README - LeetHub
1 parent c8aff5f commit 1064fe6

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

0020-valid-parentheses/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<h2><a href="https://leetcode.com/problems/valid-parentheses">20. Valid Parentheses</a></h2><h3>Easy</h3><hr><p>Given a string <code>s</code> containing just the characters <code>&#39;(&#39;</code>, <code>&#39;)&#39;</code>, <code>&#39;{&#39;</code>, <code>&#39;}&#39;</code>, <code>&#39;[&#39;</code> and <code>&#39;]&#39;</code>, determine if the input string is valid.</p>
2+
3+
<p>An input string is valid if:</p>
4+
5+
<ol>
6+
<li>Open brackets must be closed by the same type of brackets.</li>
7+
<li>Open brackets must be closed in the correct order.</li>
8+
<li>Every close bracket has a corresponding open bracket of the same type.</li>
9+
</ol>
10+
11+
<p>&nbsp;</p>
12+
<p><strong class="example">Example 1:</strong></p>
13+
14+
<div class="example-block">
15+
<p><strong>Input:</strong> <span class="example-io">s = &quot;()&quot;</span></p>
16+
17+
<p><strong>Output:</strong> <span class="example-io">true</span></p>
18+
</div>
19+
20+
<p><strong class="example">Example 2:</strong></p>
21+
22+
<div class="example-block">
23+
<p><strong>Input:</strong> <span class="example-io">s = &quot;()[]{}&quot;</span></p>
24+
25+
<p><strong>Output:</strong> <span class="example-io">true</span></p>
26+
</div>
27+
28+
<p><strong class="example">Example 3:</strong></p>
29+
30+
<div class="example-block">
31+
<p><strong>Input:</strong> <span class="example-io">s = &quot;(]&quot;</span></p>
32+
33+
<p><strong>Output:</strong> <span class="example-io">false</span></p>
34+
</div>
35+
36+
<p><strong class="example">Example 4:</strong></p>
37+
38+
<div class="example-block">
39+
<p><strong>Input:</strong> <span class="example-io">s = &quot;([])&quot;</span></p>
40+
41+
<p><strong>Output:</strong> <span class="example-io">true</span></p>
42+
</div>
43+
44+
<p><strong class="example">Example 5:</strong></p>
45+
46+
<div class="example-block">
47+
<p><strong>Input:</strong> <span class="example-io">s = &quot;([)]&quot;</span></p>
48+
49+
<p><strong>Output:</strong> <span class="example-io">false</span></p>
50+
</div>
51+
52+
<p>&nbsp;</p>
53+
<p><strong>Constraints:</strong></p>
54+
55+
<ul>
56+
<li><code>1 &lt;= s.length &lt;= 10<sup>4</sup></code></li>
57+
<li><code>s</code> consists of parentheses only <code>&#39;()[]{}&#39;</code>.</li>
58+
</ul>

0 commit comments

Comments
 (0)