C++ Simple, Short and Easy Solution, O(n) time O(1) space, faster than 100%
\nclass Solution {\npublic:\n    int minAddToMakeValid(string S) {\n        int res = 0, n = S.size(), balance = 0;\n        for (int i = 0; i < n; i++) {\n    
```\nclass Solution {\npublic:\n    int minAddToMakeValid(string S) {\n        int res = 0, n = S.size(), balance = 0;\n        for (int i = 0; i < n; i++) {\n            balance += S[i] == \'(\' ? 1 : -1;\n            if (balance == -1) {\n                res++;\n                balance++;\n            }\n        }\n        return res + balance;\n    }\n};\n```\n**Like it? please upvote...**
['C']