We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd5aae4 commit ecf35d8Copy full SHA for ecf35d8
scripts/algorithms/L/Longest Valid Parentheses/Longest Valid Parentheses.java
@@ -1,3 +1,4 @@
1
+// Runtime: 1644 ms (Top 5.15%) | Memory: 43.1 MB (Top 65.80%)
2
class Solution {
3
public int longestValidParentheses(String s) {
4
int i=0;
@@ -12,11 +13,11 @@ public int longestValidParentheses(String s) {
12
13
if(ch==')') closed++;
14
if(closed>open) break;
15
if(open==closed) len=Math.max(len,j-i+1);
-
16
+
17
j++;
18
}
19
i++;
20
21
return len;
22
-}
23
+}
0 commit comments