[Python] symmetric difference of two Set, Explained.
We get the character set for each word, and then, we just need to check the difference between any pair of two character sets.\n\nThe python set method: symmetr
We get the character set for each word, and then, we just need to check the difference between any pair of two character sets.\n\nThe python set method: `symmetric_difference` can do the job.\n\n```\nclass Solution:\n    def similarPairs(self, words: List[str]) -> int:\n        wd_set = collections.defaultdict(set)\n        for idx, wd in enumerate(words):\n            wd_set[idx] = set(wd)\n        \n        ans = 0\n        for i in range(len(words) - 1):\n            for j in range(i + 1, len(words)):\n                if len(wd_set[i].symmetric_difference(wd_set[j])) == 0:\n                    ans += 1\n        return ans\n```
['Python3']