C++ Solution using set stl 💯
\n# Code\n\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        int n = words.size();\n        vector<string> ans;\n        int cn
\n# Code\n```\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        int n = words.size();\n        vector<string> ans;\n        int cnt = 0;\n       for(auto w:words){\n           set<char>s;\n           for(auto ch : w){\n               s.insert(ch);\n           }\n           string temp = "";\n           for(auto x : s){\n               temp += x;\n           }\n            ans.push_back(temp);\n       }\n       for(int i=0 ; i<ans.size() ; i++){\n           for(int j=i+1; j<ans.size(); j++){\n               if(ans[i]==ans[j])cnt++;\n           }\n           \n    }\n    return cnt;\n    }\n\n\n};\n```
['C++']