C++ creating all subsets and storing them
\nclass Solution {\npublic:\n    bool isPalindrome(string str){\n        int i=0,j = str.length()-1;\n        while(i<j){\n            if(str[i]!=str[j])return 
```\nclass Solution {\npublic:\n    bool isPalindrome(string str){\n        int i=0,j = str.length()-1;\n        while(i<j){\n            if(str[i]!=str[j])return false;\n            i++;\n            j--;\n        }\n        return true;\n    }\n    int maxProduct(string s) {\n        int n = s.length();\n        vector<int>pal;\n        for(int i=1;i<((1<<n)-1);i++){\n            string str = "";\n            for(int j=0;j<n;j++){\n                if((1<<j)&i){\n                    str+=s[j];\n                }\n            }\n            if(isPalindrome(str)){\n                pal.push_back(i);\n            }\n        }\n        int ans = INT_MIN;\n        int n2 = pal.size();\n        for(int i = 0;i<n2-1;i++){\n            for(int j = i+1;j<n2;j++){\n                if(((pal[i]&pal[j])==0)){\n                int a = __builtin_popcount(pal[i]);\n                int b = __builtin_popcount(pal[j]);\n                ans = max(ans,a*b);}\n            }\n        }\n        return ans;\n    }\n};\n```
[]