[C++] 15 ms optimized solution using map and bitmask
Intuition\n Describe your first thoughts on how to solve this problem. \nI converted the given strings into a bitmask and counted the frequency of those bitmask
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nI converted the given strings into a bitmask and counted the frequency of those bitmask in an unordered map.\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)$$ -->\n0(n*l) where l is length of longest string\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        unordered_map <int,int> mp;\n        for(auto x:words){\n            int mask = 0;\n            for(int i = 0; i <x.size(); i++){\n                mask |= 1<<(x[i]-\'a\');\n            }\n            mp[mask]++;\n        }\n        int count = 0;\n        for(auto x:mp){\n            int c = x.second;\n            count+= c*(c-1)/2;\n        }\n        return count;\n    }\n};\n```
['C++']