经典的用栈判断语法合法性问题 #include <stack> #include <unordered_map> class Solution { public: unordered_map<char, char> char_map = {{'(', ')'}, {'{', '}'}, {'[', ']'}}; bool isValid(string s) { stack<char> stack; for (int i = 0; i < s.size(); i++) { ...