SIMPLE STACK C++ COMMENTED  SOLUTION
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:o(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:o(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n\nclass Solution {\npublic:\n    int minAddToMakeValid(string s) {\n       stack<char> stk;\n        int moves = 0;\n        for(auto&c : s){\n            if(c == \'(\'){\n                // Push opening brackets onto the stack\n                stk.push(c);\n            }else{\n                // If it\'s a closing bracket\n                if (!stk.empty() && stk.top() == \'(\'){\n                    // Pop the stack if there\'s a matching opening bracket\n                    stk.pop();\n                }else{\n                    // Otherwise, we need an extra opening bracket\n                    moves++;\n                }\n            }\n        }\n    //  s = "(((" for this case we need 3 close brackets, moves = 0 , 0 + 3;\n        // Add remaining unmatched opening brackets to the moves\n        moves+=stk.size();\n        return moves;\n    }\n};\n```
['C++']