One line solution
Code\n\nclass Solution {\n    func maximumNumberOfStringPairs(_ words: [String]) -> Int {\n        return words.count - Set(words.map(Set.init)).count\n    }\n}
# Code\n```\nclass Solution {\n    func maximumNumberOfStringPairs(_ words: [String]) -> Int {\n        return words.count - Set(words.map(Set.init)).count\n    }\n}\n```
['Swift']