Solution1 DFS
traverse s, get matched left and right parentheses count
dfs, delete corresponding left and right parenthese, and see if is valid
Last updated
Was this helpful?
traverse s, get matched left and right parentheses count
dfs, delete corresponding left and right parenthese, and see if is valid
Last updated
Was this helpful?