Python || 96.77% Faster || Explained || Without Stack || O(n) Solution
\nclass Solution:\n    def removeOuterParentheses(self, s: str) -> str:\n        c,j,n=0,0,len(s)\n        ans=[]\n        for i in range(n):\n            if s[
```\nclass Solution:\n    def removeOuterParentheses(self, s: str) -> str:\n        c,j,n=0,0,len(s)\n        ans=[]\n        for i in range(n):\n            if s[i]==\'(\':\n                c+=1 #If there is opening paranthesis we increment the counter variable\n            else:\n                c-=1 #If there is closing paranthesis we decrement the counter variable\n#If counter variable is 0 it means that No. of opening paranthesis = No. of closing paranthesis and we get a set of valid parethesis \n\t\t\t\tif c==0:\n#Once we get a valid set of parenthesis we store it in the list where j is the starting index of the valid parenthesis set and i is the last index.\n#j+1 will remove the opening parenthesis and slicing the string till i(i.e., i-1) will store the valid set of parethesis in list after removing the outermost parenthis\n                    ans.append(s[j+1:i])\n                    j=i+1 #Changing the value of starting index for next valid set of parenthesis\n        return \'\'.join(ans) #It will change the list into string\n```\n\n**Upvote if you like the solution or ask if there is any query**\n            \n
['Python', 'Python3']