/**
* @param {string[]} words
* @return {number}
*/
var similarPairs = function(words) {
let count = 0
for (let i = 0; i < words.length; i++) {
for (let j = i + 1; j < words.length; j++) {
const str1 = Array.from(new Set(words[i].split('').sort())).join('')
const str2 = Array.from(new Set(words[j].split('').sort())).join('')
if (str1 === str2) {
count++
}
}
}
return count
};