Python Bit Mask + Dict
Approach\n Describe your approach to solving the problem. \n\nStore the number of strings with particular set of unique characters in hashmap. Use permutations 
# Approach\n<!-- Describe your approach to solving the problem. -->\n\nStore the number of strings with particular set of unique characters in hashmap. Use permutations and combinations to get the total number of pairs with that particular set.\n\nTo learn about bit mask for storing unique characters, here is a [good stackoverflow thread](https://stackoverflow.com/questions/9141830/explain-the-use-of-a-bit-vector-for-determining-if-all-characters-are-unique)\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n$$O(nW)$$\n\n$$n$$: number of words\n$$W$$: max length of the word\n\n# Code\n```\nclass Solution:\n    def createHash(self, word):\n        h = 0\n        for i in word:\n            val =  ord(i) - ord(\'a\') \n            h = h | (1<<val)\n        return h\n\n    def similarPairs(self, words: List[str]) -> int:\n        d = defaultdict(int)\n\n        for i in words:\n            h = self.createHash(i)\n            d[h] += 1\n        \n        num = 0\n        for v in d.values():\n            num = num + ((v*(v-1))//2)\n        \n        return num\n\n\n```
['Hash Table', 'Bitmask', 'Python3']