[Java] Backtracking Solution
\nclass Solution {\n    public int maxProduct(String s) {\n        return dfs(s.toCharArray(),"","",0,0);\n    }\n    \n    public int dfs(char[] arr,String s,S
```\nclass Solution {\n    public int maxProduct(String s) {\n        return dfs(s.toCharArray(),"","",0,0);\n    }\n    \n    public int dfs(char[] arr,String s,String p,int pos,int max){\n        if(pos == arr.length){\n            if(isValid(s) && isValid(p))max = Math.max(max,s.length() * p.length());\n            return max;\n        }\n        return Math.max(dfs(arr,s + arr[pos],p,pos + 1,max),Math.max(dfs(arr,s,p + arr[pos],pos+1,max),dfs(arr,s,p,pos+1,max)));\n    }\n    \n    public boolean isValid(String s){\n        int i = 0,j = s.length()-1;\n        while(i < j)if(s.charAt(i++) != s.charAt(j--))return false;\n        return true;\n    }\n}\n```
['Java']