You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2><ahref="https://leetcode.com/problems/longest-valid-parentheses">Longest Valid Parentheses</a></h2> <imgsrc='https://img.shields.io/badge/Difficulty-Hard-red'alt='Difficulty: Hard' /><hr><p>Given a string containing just the characters <code>'('</code> and <code>')'</code>, return <em>the length of the longest valid (well-formed) parentheses </em><spandata-keyword="substring-nonempty"><em>substring</em></span>.</p>
2
+
3
+
<p> </p>
4
+
<p><strongclass="example">Example 1:</strong></p>
5
+
6
+
<pre>
7
+
<strong>Input:</strong> s = "(()"
8
+
<strong>Output:</strong> 2
9
+
<strong>Explanation:</strong> The longest valid parentheses substring is "()".
10
+
</pre>
11
+
12
+
<p><strongclass="example">Example 2:</strong></p>
13
+
14
+
<pre>
15
+
<strong>Input:</strong> s = ")()())"
16
+
<strong>Output:</strong> 4
17
+
<strong>Explanation:</strong> The longest valid parentheses substring is "()()".
0 commit comments