Simplest Solution With Explanation
\n\n# Code\n\nclass Solution {\npublic:\n    // To check whether a string is palindrome or not.\n    bool isPalindrome(string s) {\n        int n = s.size();\n 
\n\n# Code\n```\nclass Solution {\npublic:\n    // To check whether a string is palindrome or not.\n    bool isPalindrome(string s) {\n        int n = s.size();\n        for (int i = 0; i < n / 2; i++) {\n            if (s[i] != s[n-i-1]) {\n                return false;\n            }\n        }\n        return true;\n    }\n    int maxProduct(int i, string s1, string s2, string &s) {\n        // If we have traversed the whole string, we check the two strings picked on the way whether they are\n        // palindrome or not. If they are, we can return their product.\n        if (i == s.size()) {\n\n            if (isPalindrome(s1) && isPalindrome(s2)) {\n                return (s1.size()) * (s2.size());\n            }\n            return 0;\n        }\n\n        // We have two options for every index either not pick it or pick it.\n        // If we want to pick it we can add it to string1 or string2 but not both simultaneously.\n        int notTake = maxProduct(i + 1, s1, s2, s); \n        int take1 = maxProduct(i + 1, s1 + s[i], s2, s);\n        int take2 = maxProduct(i + 1, s1, s2 + s[i], s);\n\n        // Finally we take max of all options.\n        return max({notTake, take1, take2});\n    }\n    int maxProduct(string s) {\n        return maxProduct(0, "", "", s); // [index, string1, string2, string]\n    }\n};\n```
['Dynamic Programming', 'Backtracking', 'Recursion', 'C++']