Java | Simple | Backtracking
\npublic int maxProduct(String s) {\n        solve(s, "", "", 0);\n        return ans;\n    }\n    int ans;\n    void solve(String s, String s1, String s2, int 
```\npublic int maxProduct(String s) {\n        solve(s, "", "", 0);\n        return ans;\n    }\n    int ans;\n    void solve(String s, String s1, String s2, int start) {\n        if(start == s.length()) {\n            if(isPal(s1) && isPal(s2)) {\n                int val = s1.length()*s2.length();\n                ans = Math.max(ans, val);\n            }\n            return;\n        }\n        char ch = s.charAt(start);\n        solve(s, s1+ch, s2, start+1);\n        solve(s, s1, s2+ch, start+1);\n        solve(s, s1, s2, start+1);\n    }\n    \n    boolean isPal(String s) {\n        int i = 0;\n        int j = s.length() -1;\n        while(i<j) {\n            if(s.charAt(i) != s.charAt(j)) {\n                return false;\n            }\n            i++;\n            j--;\n        }\n        return true;\n    }\n```
['Backtracking', 'Java']