Skip to content

Commit 57ca631

Browse files
refactor 32
1 parent 31a94f6 commit 57ca631

File tree

1 file changed

+10
-2
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+10
-2
lines changed

src/main/java/com/fishercoder/solutions/_32.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@
66
* 32. Longest Valid Parentheses
77
*
88
* 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 "()()"
1119
*/
1220
public class _32 {
1321
public static class Solution1 {

0 commit comments

Comments
 (0)