← 返回 meta 的题目列表Find Minimum Parentheses to Balance
类型:online_judge
Given a string containing open and/or close parentheses, find the minimum number of parentheses needed to be added to balance the string. A valid parentheses sequence requires matching open and close parentheses in correct order. Implement a function minAddToMakeValid(s: str) -> int.
Example
Input
()