Count Pairs of Similar Strings

Two strings are similar if they contain the same set of characters. Convert each word to a character-set bitmask and count pairs of words sharing identical masks.

Examples
Input: ["aba","aabb","abcd","bac","aabc"]
Output: 2
Hints

Count Pairs of Similar Strings

Two strings are similar if they contain the same set of characters. Convert each word to a character-set bitmask and count pairs of words sharing identical masks.