Simple solution on Swift
Code\n\nclass Solution {\n    func similarPairs(_ words: [String]) -> Int {\n        var result = 0\n        for i in 0..<words.count {\n            for j in i+
# Code\n```\nclass Solution {\n    func similarPairs(_ words: [String]) -> Int {\n        var result = 0\n        for i in 0..<words.count {\n            for j in i+1..<words.count where Set(words[j]) == Set(words[i]) {\n                result += 1\n            }\n        }\n        return result\n    }\n}\n```\n### Please upvote if you found the solution useful!
['Swift']