simple and easy understand solution
if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n\nclass Solution {\npublic:\n    int minAddToMakeValid(string s) \n    {\n        string ok;\n  
# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n```\nclass Solution {\npublic:\n    int minAddToMakeValid(string s) \n    {\n        string ok;\n        int ans = 0;\n        for(char c:s)\n        {\n            if(c==\'(\') ok += c;\n            else \n            {\n                if(ok.empty()) ans++;\n                else ok.pop_back();\n            }\n        }\n        return ok.size() + ans;\n    }\n};\n```
['String', 'Stack', 'Greedy', 'C', 'C++', 'Java', 'C#']