✔ C++ using Map
\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        int ans = 0, n = words.size();\n        for(int i = 0; i < n - 1; ++i) {\n  
```\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        int ans = 0, n = words.size();\n        for(int i = 0; i < n - 1; ++i) {\n            // use a map to count frequency of the current word\n            unordered_map<char, int> mp1;\n            for(char &c : words[i]) \n                mp1[c] = 1;\n            for(int j = i + 1; j < n; ++j) {\n                // use this map to compare\n                unordered_map<char, int> mp2;\n                for(char &c : words[j]) mp2[c] = 1;\n                // if same \n                if(mp1 == mp2) \n                    ans++;\n            }\n        }\n        return ans;\n    }\n};\n```\n\nThanks a lot for reading! ^_^\n\uD83D\uDCAF An upvote would be appreciated.\n\uD83D\uDC47 Comment down your doubts (if any).
['C']