Simple Java Solution Using Stack
\nclass Solution {\n    public int minAddToMakeValid(String s) {\n       \n        Stack<Character> stk = new Stack();\n        for(int i=0;i<s.length();i++){\n
```\nclass Solution {\n    public int minAddToMakeValid(String s) {\n       \n        Stack<Character> stk = new Stack();\n        for(int i=0;i<s.length();i++){\n            \n             if(!stk.isEmpty() && s.charAt(i)==\')\' && stk.peek()==\'(\'){\n                stk.pop();\n            }\n            else{\n                stk.push(s.charAt(i));\n            }\n        }\n        \n        return stk.size();\n        \n    }\n}\n```
['Stack', 'Java']