Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d8d75b0

Browse files
committed
Added README.md file for Maximum Nesting Depth of the Parentheses
1 parent 4ef9c30 commit d8d75b0

File tree

1 file changed

+43
-0
lines changed
  • 1737-maximum-nesting-depth-of-the-parentheses

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<h2><a href="https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses">Maximum Nesting Depth of the Parentheses</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Given a <strong>valid parentheses string</strong> <code>s</code>, return the <strong>nesting depth</strong> of<em> </em><code>s</code>. The nesting depth is the <strong>maximum</strong> number of nested parentheses.</p>
2+
3+
<p>&nbsp;</p>
4+
<p><strong class="example">Example 1:</strong></p>
5+
6+
<div class="example-block">
7+
<p><strong>Input:</strong> <span class="example-io">s = &quot;(1+(2*3)+((8)/4))+1&quot;</span></p>
8+
9+
<p><strong>Output:</strong> <span class="example-io">3</span></p>
10+
11+
<p><strong>Explanation:</strong></p>
12+
13+
<p>Digit 8 is inside of 3 nested parentheses in the string.</p>
14+
</div>
15+
16+
<p><strong class="example">Example 2:</strong></p>
17+
18+
<div class="example-block">
19+
<p><strong>Input:</strong> <span class="example-io">s = &quot;(1)+((2))+(((3)))&quot;</span></p>
20+
21+
<p><strong>Output:</strong> <span class="example-io">3</span></p>
22+
23+
<p><strong>Explanation:</strong></p>
24+
25+
<p>Digit 3 is inside of 3 nested parentheses in the string.</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">3</span></p>
34+
</div>
35+
36+
<p>&nbsp;</p>
37+
<p><strong>Constraints:</strong></p>
38+
39+
<ul>
40+
<li><code>1 &lt;= s.length &lt;= 100</code></li>
41+
<li><code>s</code> consists of digits <code>0-9</code> and 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>.</li>
42+
<li>It is guaranteed that parentheses expression <code>s</code> is a VPS.</li>
43+
</ul>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /