Easy for Beginner in C++ || Stack
class Solution {\npublic:\n\n\n    int minAddToMakeValid(string s){\n        stack st;\n        int count=0;\n        for(int i=0;i<s.length();i++){\n          
class Solution {\npublic:\n\n\n    int minAddToMakeValid(string s){\n        stack<int> st;\n        int count=0;\n        for(int i=0;i<s.length();i++){\n            if(s[i]==\'(\'){\n                st.push(i);\n            }\n            else if(s[i]==\')\'){\n                if(st.empty()){\n                    count+=1;\n                }\n                else{\n                    st.pop();\n                }\n            }\n        }\n        return st.size()+count;\n    }\n};
[]