leet-code/longest-valid-parentheses/sol.rs

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 {
}
}
}
}