C++|| For Beginners..!!! || Stack
\nclass Solution {\npublic:\n    int minAddToMakeValid(string s) {\n        stack<char> st;\n        int count=0;\n        for(int i=0;i<s.size();i++){\n       
```\nclass Solution {\npublic:\n    int minAddToMakeValid(string s) {\n        stack<char> st;\n        int count=0;\n        for(int i=0;i<s.size();i++){\n            if(s[i]==\')\'){\n                if(st.empty())\n                    count++;\n                else if(st.top()==\'(\')\n                      st.pop();\n                else\n                    st.push(s[i]);\n            }\n            else if(s[i]==\'(\')\n                st.push(s[i]);\n        }\n        return st.size()+count;\n    }\n};\n```
['Stack', 'C', 'C++']