Problem: 921. Minimum Add to Make Parentheses Valid 使括号有效的最少添加耗时100%栈若满足栈顶(‘当前’)则pop栈顶否则push最后返回栈的大小Codeclass Solution { public: int minAddToMakeValid(string s) { stackchar tk; for(char c : s) { if( tk.empty() false tk.top()( c) ) { tk.pop(); continue; } tk.push(c); } return tk.size(); } };