C++✅✅| Beats 100% | self-Explained🔥 | Beginner Friendly Approach✔ | Clean Code |stack
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string removeOuterParentheses(string s) {\n        string result;\n        stack <char> st;\n        for(int i:s)\n        {\n            if(i==\'(\')\n            {\n                if(!st.empty())\n                {\n                result.push_back(i);\n                }\n                st.push(i);\n            }\n            else{\n                st.pop();\n                if(!st.empty())\n                {\n                    result.push_back(i);\n                }\n            }\n            \n        }\n        return result;\n    }\n};\n```
['Stack', 'C++']