C++ Set
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        vector<string> v;\n        for(int i=0;i<words.size();i++)\n        {\n            set<char> s;\n            for(int j=0;j<words[i].size();j++)\n            {\n                if(s.count(words[i][j])==0)\n                    s.insert(words[i][j]);\n            }\n            string temp="";\n            for(auto& i:s)\n            {\n                temp.push_back(i);\n            }\n            sort(temp.begin(),temp.end());\n            cout<<temp<<" ";\n            v.push_back(temp);\n        }\n        map<string,int> mp;\n        for(int i=0;i<words.size();i++)\n        {\n            mp[v[i]]++;\n        }\n        int c=0;\n        for(auto i:mp)\n        {\n            if(i.second>1)\n                c=c+(i.second*(i.second-1))/2;\n        }\n        return c;\n    }\n};\n```
['Math', 'Ordered Set', 'C++']