bitmask | hashing | C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    priority_queue<int, vector<int>, greater<int>> pq;\npublic:\n    bool isPalindrome(string& s){\n        int l=0, r = s.size()-1;\n        while(l <= r){\n            if(s[l] != s[r]) return false;\n            l++;\n            r--;\n        }\n        return true;\n    }\n    int maxProduct(string s) {\n       int n = s.size();\n       unordered_map<int, int> mp;\n       for(int i=1; i<(1<<n); i++){\n          string t;\n          for(int j=0; j<n; j++){\n              if(i&(1<<j))t.push_back(s[j]);\n          }\n          if(isPalindrome(t)) mp[i] = t.size();\n       }\n       int res = 0;\n       for(auto& x : mp){\n           for(auto& y : mp){\n             if((x.first & y.first) == 0) res = max(res, x.second* y.second);\n           }\n       }\n       return res;\n    }\n};\n```
['C++']