Minimum add to make parentheses valid
Return the fewest parentheses to insert so a string of ( and ) becomes balanced, counting unmatched openers and closers in one pass.
No answer yet. Write the first one; the best answer gets endorsed.
Return the fewest parentheses to insert so a string of ( and ) becomes balanced, counting unmatched openers and closers in one pass.