Easy C++ Backtracking Solution
\nclass Solution {\npublic:\n    int ans=0;\n    bool pal(string &s){\n        int l=s.length();\n        for(int i=0;i<l-1-i;i++) \n            if(s[i]!=s[l-1-
```\nclass Solution {\npublic:\n    int ans=0;\n    bool pal(string &s){\n        int l=s.length();\n        for(int i=0;i<l-1-i;i++) \n            if(s[i]!=s[l-1-i]) return false;\n        return true;\n    }\n    void dfs(int curr,string &s1,string &s2,int l, string &s){\n        if(curr==l){\n            if(pal(s1) && pal(s2)){\n                ans=max(ans,(int)s1.length()*(int)s2.length());\n            }\n            return;\n        }\n        s1.push_back(s[curr]);\n        dfs(curr+1,s1,s2,l,s);\n        s1.pop_back();\n        \n        s2.push_back(s[curr]);\n        dfs(curr+1,s1,s2,l,s);\n        s2.pop_back();\n        \n        dfs(curr+1,s1,s2,l,s);\n    }\n    int maxProduct(string &s) {\n        int l=s.length();\n        string s1,s2;\n        dfs(0,s1,s2,l,s);\n        return ans;\n    }\n};\n```
['Backtracking', 'C']