Java Solution - Standard Recursion and Backtracking
Idea\nFirst you need to find the first pallin subsequence string then you need to remove that string from the original string and finding the another pallin sub
**Idea**\nFirst you need to find the first pallin subsequence string then you need to remove that string from the original string and finding the another pallin subsequence string.\n```\nclass Solution {\n\tint max=Integer.MIN_VALUE;\n\tvoid recur(String str,int n,int ind,String s,List<Integer> list)\n\t{\n\t\tif(ind==n)\n        {   \n           if(isPallin(str))\n           {\n\t           \tString st="";\n\t           \tfor(int i=0;i<n;i++)\n\t           \t\tif(!list.contains(i))\n\t           \t\t\tst+=s.charAt(i);\n                recur1("", st.length(), 0, st,str);\n           }\n           return;\n        }\n\t\trecur(str,n,ind+1,s,new ArrayList(list));\n\t\tstr+=s.charAt(ind);\n\t\tlist.add(ind);\n\t\trecur(str,n,ind+1,s,new ArrayList(list));\n\t}\n\tvoid recur1(String str,int n,int ind,String s,String st)\n\t{\n\t\tif(ind==n)\n        {\n            if(isPallin(str))\n                max=Math.max(max,st.length()*str.length());\n            return;\n        }\n\t\trecur1(str,n,ind+1,s,st);\n\t\tstr+=s.charAt(ind);\n\t\trecur1(str,n,ind+1,s,st);\n\t}\n\tboolean isPallin(String s)\n\t{\n\t\tint i=0,j=s.length()-1;\n\t\twhile(i<j)\n\t\t{\n\t\t\tif(s.charAt(i)!=s.charAt(j))\n\t\t\t\treturn false;\n            i++;\n            j--;\n\t\t}\n\t\treturn true;\n\t}\n    public int maxProduct(String s) {\n    \t\n        recur("",s.length(),0,s,new ArrayList());\n        return max;\n    }\n}\n```\nAny Questions??\nelse\nPlease do upvote:))
['Backtracking', 'Java']