Easy brute force solution in c++
\n\n\n\nclass Solution {\npublic:\n    bool isPalindrome(string str)\n    {\n        // Start from leftmost and rightmost corners of str\n        int l = 0;\n  
\n\n```\n\nclass Solution {\npublic:\n    bool isPalindrome(string str)\n    {\n        // Start from leftmost and rightmost corners of str\n        int l = 0;\n        int h = str.size()-1;\n\n        // Keep comparing characters while they are same\n        while (h > l)\n        {\n            if (str[l++] != str[h--])\n            {\n                return false;\n            }\n        }\n        return true;\n    }\n    int maxProduct(string s) {\n        vector<pair<string,long long>> v;\n        \n        long long n = s.size();\n        long long power = pow(2,n);\n\t\t\n\t\t\n        for(int i=0;i<power;i++){\n            string ans="";\n            for(int j=0;j<n;j++){\n                if(i&1<<j){\n                    ans = ans + s[j];\n                }\n            }\n            if(isPalindrome(ans)){\n                v.push_back({ans,i});\n            }\n        }\n        long long val=1;\n        for(int i=0;i<v.size()-1;i++){\n            for(int j=1;j<v.size();j++){\n                if((v[i].second & v[j].second)==0){\n                    \n                        long long ik = v[i].first.size();\n                        long long jk = v[j].first.size();\n                       \n                        if(ik*jk>val){\n                            val = ik*jk;\n                        }\n     \n                }\n            }\n        }\n        return val;\n    }\n};\n```
[]