faster than 93.69%, less than 94.86% , C++, simple and concise
\nclass Solution {\npublic:\n    int maxProduct(string s) {\n        int n=s.size();\n        int maskMax=1<<n-1;\n        \n        int ret=0;\n        for(int
```\nclass Solution {\npublic:\n    int maxProduct(string s) {\n        int n=s.size();\n        int maskMax=1<<n-1;\n        \n        int ret=0;\n        for(int mask=1;mask<maskMax;mask++){\n            string s1,s2;\n            for(int i=0;i<s.size();i++){\n                if(mask & 1<<i)\n                    s1+=s[i];\n                else\n                    s2+=s[i];\n            }\n            int MaxLen1=helper(s1, 0, s1.size()-1);\n            int MaxLen2=helper(s2, 0, s2.size()-1);\n            ret=max(ret, MaxLen1*MaxLen2);\n        }\n        \n        return ret;\n    }\n    \n    int helper(string& s, int l, int r){\n        if(l>r)\n            return 0;\n        if(l==r)\n            return 1;\n        if(s[l]==s[r])\n            return 2+helper(s, l+1, r-1);\n        else\n            return max(helper(s, l+1, r), helper(s, l, r-1));\n    }\n};\n```
[]