C++ Backtrack
\nclass Solution {\npublic:\n    int ans;\n    void dfs(int i, string& s, string& s1, string& s2){\n        \n        if(i == size(s)){\n            \n         
```\nclass Solution {\npublic:\n    int ans;\n    void dfs(int i, string& s, string& s1, string& s2){\n        \n        if(i == size(s)){\n            \n            ans = max(ans, (isPal(s1) * isPal(s2)) );\n            \n            return;\n        }\n        \n        // choose ith character for s1 (not for s2)\n        \n        s1.push_back(s[i]);\n        dfs(i+1, s, s1, s2);\n        \n        //backtrack\n        \n        s1.pop_back();\n        \n        // choose ith character for s2 (not for s1)\n        \n        s2.push_back(s[i]);\n        dfs(i+1, s, s1, s2);\n        s2.pop_back();\n        dfs(i+1, s, s1, s2);\n    }\n    int maxProduct(string& s) {\n        \n        ans = 0;\n        string s1 = "",s2 = "";\n        dfs(0, s, s1, s2);\n        \n        return ans;\n        \n    }\n    private:\n        int isPal(string& s) {\n        \n        int n = size(s);\n        int i = 0, j = n-1;\n            \n        while(i <= j){\n            \n            if(s[i++] != s[j--]){\n                \n                return 0;\n            }\n        }\n            \n        return n;\n    }\n};\n```
['Backtracking', 'C', 'C++']