Remove the minimum number of parentheses to make the string valid.
Constraints
Example
>>> min_remove_to_make_valid('leet(tc)ode')
'leet(tc)ode'
>>> min_remove_to_make_valid('a)b(c)d')
'ab(c)d'
>>> min_remove_to_make_valid('))((')
''
>>> min_remove_to_make_valid('(a(b(c)d)')
'a(b(c)d)'
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints