✅✅ C++ || BACKTRACKING || EXPLAINED
```\n/\nwe will try out all possibilities through recursion \nbase condition will be where we would have \ntraversed through the whole string , \nthis is the po
```\n/*\nwe will try out all possibilities through recursion \nbase condition will be where we would have \ntraversed through the whole string , \nthis is the point where we will check whether\nour 2 subsequences are palindromic , and \nif yes , then we will compare the product \nof the lengths of 2 strings with our ans\n\n\nrecurrence realation will contain three recursive calls , \nfirst for not inlcuding s[i] in both the strings \nsecond for inlcuding s[i] in the string s1\nthird for inlcuding s[i] in the string s2\n\nand we will get our ans recursively\n\n*/\nclass Solution {\npublic:\n    bool ispalindrome(string s){\n    int i = 0,j = s.size()-1;\n    while(i<j){\n        if(s[i]!=s[j]) return false;\n        i++;\n        j--;\n    }\n    return true;\n}\n    \n    void solve(string &s , string &s1 , string &s2 , int i , int &ans){\n        if(i>=s.size()){\n            if(ispalindrome(s1) && ispalindrome(s2)){\n                int x=s1.size()*s2.size();\n                ans=max(ans,x);\n                \n            }\n            return ;\n        }\n        \n//*******************************************************************************  \n        \n        // here we have not used backtracking , \n        //but here we will not able to use &s1/&s2  ,\n        //ie reference based addressing , and \n        //therefore a new copy of s1 and s2 will be made each time\n        //, resulting in TLE\n        \n//         // we dont add in either of the strings\n//         solve(s,s1,s2,i+1,ans);\n        \n//         // adding in s1;\n//         solve(s,s1+s[i],s2,i+1,ans);\n        \n//         // adding in s2\n//         solve(s,s1,s2+s[i],i+1,ans);\n//*******************************************************************************     \n\n           // we dont add in either of the strings\n            solve(s,s1,s2,i+1,ans);\n    \n            //pic in first string s1\n            s1.push_back(s[i]);\n            solve(s,s1,s2,i+1,ans);\n            s1.pop_back();\n\n            //pic in second string s2\n            s2.push_back(s[i]);\n            solve(s,s1,s2,i+1,ans);\n            s2.pop_back();\n    \n    }\n\n    int maxProduct(string s) {\n        string s1="";\n        string s2="";\n        int ans=0;\n        solve(s,s1,s2,0,ans);\n        return ans;\n    }\n};
['Backtracking', 'Recursion', 'C']