Python3 Simple Hash Map Solution
\n# Approach\n1. We can hash the word as its unique characters sorted i.e bacddd == abcd.\n2. Now loop through the words updating the counts of each word type t
\n# Approach\n1. We can hash the word as its unique characters sorted i.e `bacddd == abcd`.\n2. Now loop through the words updating the counts of each word type to find the amount of similar words. \n3. To find how many pairs there are we use the $$nC_2$$ formula which is simplified as $$\\frac{n*(n-1)}{2}$$\n\n# Code\n```\nclass Solution:\n    def similarPairs(self, words: List[str]) -> int:\n        counts = {}\n        \n        for word in words:\n            s = str(sorted(set(word)))\n            \n            if s in counts:\n                counts[s] += 1\n            else:\n                counts[s] = 1\n                \n        return sum(int(n*(n-1)/2) for n in counts.values())\n\n```
['Python3']