File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 6
6
* 32. Longest Valid Parentheses
7
7
*
8
8
* Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
9
- * For "(()", the longest valid parentheses substring is "()", which has length = 2.
10
- * Another example is ")()())", where the longest valid parentheses substring is "()()", which has length = 4.
9
+ *
10
+ * Example 1:
11
+ * Input: "(()"
12
+ * Output: 2
13
+ * Explanation: The longest valid parentheses substring is "()"
14
+ *
15
+ * Example 2:
16
+ * Input: ")()())"
17
+ * Output: 4
18
+ * Explanation: The longest valid parentheses substring is "()()"
11
19
*/
12
20
public class _32 {
13
21
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments