Remove Outermost Parentheses|| cpp|| easy way
\n\nclass Solution {\npublic:\n    string removeOuterParentheses(string s) {\n        int count = 0;\n        string ans = "";\n        for(int i=0;i0){\n      
```\n```\nclass Solution {\npublic:\n    string removeOuterParentheses(string s) {\n        int count = 0;\n        string ans = "";\n        for(int i=0;i<s.length();i++){\n            if( s[i]==\'(\' && count == 0){\n                count++;\n            }\n            else\n                if(s[i]==\'(\' && count>0){\n                    count++;\n                    ans+=s[i];\n                }\n            else if(s[i]==\')\'){\n                count--;\n                if(count>0)ans+=s[i];\n            } \n        }\n        return ans;\n        \n    }\n};\n```\n```
[]