C++ and C# very easy solution.
Intuition:First of all,we have to find outer parentheses and after that we have to add other parentheses to a new string.\n Describe your first thoughts on how 
# Intuition:First of all,we have to find outer parentheses and after that we have to add other parentheses to a new string.\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach:Each pair has a couple of parenthese.So we use stack to declare which parenthese is either opener or cleser.\n<!-- Describe your approach to solving the problem. -->\n![photo_2023-04-10_05-40-10.jpg](https://assets.leetcode.com/users/images/399e55fc-74f8-4ba0-809c-086907be6e71_1681087371.7124531.jpeg)\n\n\n```C++ []\nclass Solution {\npublic:\n    string removeOuterParentheses(string s) {\n        string result;\n        int index = 0;\n        for (char x : s) {\n           switch(x){\n               case \'(\':\n               if(index++>0)result+=x;\n               break;\n               case \')\':\n               if(index-->1)result+=x;\n               break;\n           }\n        }\n        return result;\n    }\n};\n```\n```C# []\npublic class Solution {\n    public string RemoveOuterParentheses(string s) {\n        StringBuilder result=new();\n        int index = 0;\n        foreach (char x in s) {\n            if (x == \'(\' && index++ > 0) \n            result.Append(x);\n            else if (x == \')\' && index-- > 1) \n            result.Append(x);\n        }\n        return result.ToString();\n    }\n}\n```\n
['String', 'Stack', 'C++', 'C#']