Set & String
\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        int ans = 0;\n        vector<string> v;\n        for(auto w: words){\n      
```\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        int ans = 0;\n        vector<string> v;\n        for(auto w: words){\n            set<char> s;\n            for(auto c: w) s.insert(c);\n            string t = "";\n            for(auto m: s) t += m;\n            v.push_back(t);\n        }\n        for(int i = 0; i < v.size(); ++i){\n            for(int j = i+1; j < v.size(); ++j){\n                if(v[i] == v[j]) ans++;\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']