19 lines
406 B
Rust
19 lines
406 B
Rust
|
// Incomplete
|
||
|
impl Solution {
|
||
|
pub fn longest_valid_parentheses(s: String) -> i32 {
|
||
|
if s.len() == 0 { 0 }
|
||
|
let mut s = 0;
|
||
|
let mut open = 0;
|
||
|
let mut acc = 0;
|
||
|
for c in s.chars().into_iter() {
|
||
|
if c == '(' {
|
||
|
open += 1;
|
||
|
} else {
|
||
|
open -= 1;
|
||
|
}
|
||
|
if open == 0 {
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|