Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Minimum Add to Make Parentheses Valid
Bookmark
Input
Example 1
All open
Balanced
Mixed
Custom
s
=
())
s
0
(
1
)
2
)
unmatchedOpen = 0
unmatchedClose = 0
Matched
Unmatched (
Unmatched )
algo
master
.
io
Step:
Start: Count minimum additions to make parentheses valid
0 / 8
Input
Example 1
All open
Balanced
Mixed
Custom
s
=
())
0 / 8
s
0
(
1
)
2
)
unmatchedOpen = 0
unmatchedClose = 0
Matched
Unmatched (
Unmatched )
algo
master
.
io
Step:
Start: Count minimum additions to make parentheses valid