Simple String operation....No STACKS USED....Easy to Understand
\nclass Solution {\n    public String removeOuterParentheses(String S) {\n        String k="",s="";int c=0,d=0;// c-> to count no. of \'(\' and d->no. of \')\' 
```\nclass Solution {\n    public String removeOuterParentheses(String S) {\n        String k="",s="";int c=0,d=0;// c-> to count no. of \'(\' and d->no. of \')\' \n        for(int i=0;i<S.length();i++)\n        {\n            if(S.charAt(i)==\'(\'){\n            s=s+\'(\';\n                c++;\n            }\n            else if(S.charAt(i)==\')\')\n            {\n                s=s+\')\';\n                d++;\n            }\n            if(c==d)// when c==d means one complete bracket series ended....eg: (()()) c==d for this.... \n            {\n                k=k+s.substring(1,s.length()-1);// select the string execpt first and last portion 1 -> s.length()-1,which gives ()()\n                s="";//this for next bracket series\n                c=d=0;//for next bracket series....\n            }\n        }\n        return k;\n    }\n}\n```
['String', 'Java']