1541. Minimum Insertions to Balance a Parentheses String
Description
**Input:** s = "(()))"
**Output:** 1
**Explanation:** The second '(' has two matching '))', but the first '(' has only ')' matching. We need to to add one more ')' at the end of the string to be "(())))" which is balanced.**Input:** s = "())"
**Output:** 0
**Explanation:** The string is already balanced.ac
Last updated