C++ || NOT sure How DP is used in my soln.
TC: O( 3 ^N )\nSC: O(1) +  Auxiliary Stack Space O(N)\n\nclass Solution {\npublic:\n    bool isPalindrome(string &str){\n        int i=0,j=str.size()-1;\n      
TC: O( 3 ^N )\nSC: O(1) +  Auxiliary Stack Space O(N)\n```\nclass Solution {\npublic:\n    bool isPalindrome(string &str){\n        int i=0,j=str.size()-1;\n        while(i<j){\n            if(str[i]!=str[j])\n                return false;\n            i++;\n            j--;\n        }\n        return true;\n    }\n    void solve(int i,string &s1,string &s2,string &s,int &ans){\n        //base case\n        if(i>=s.size()){\n            if(isPalindrome(s1) && isPalindrome(s2)){\n                int prod=s1.size()*s2.size();\n                ans= max(ans,prod);\n            }\n            return;\n        }\n        //dont pick\n        solve(i+1,s1,s2,s,ans);\n        \n        //pick\n        s1+=s[i];\n        solve(i+1,s1,s2,s,ans);\n        s1.pop_back();\n        s2+=s[i];\n        solve(i+1,s1,s2,s,ans);\n        s2.pop_back();\n    }\n    \n    int maxProduct(string s) {\n        int n=s.size();\n        int ans=0;\n        string s1="",s2="";\n        solve(0,s1,s2,s,ans);\n        return ans;\n    }\n};\n```
['Backtracking', 'C++']