✅ Simple and Easy to Understand || Beginners Friendly || C++ ✅
\n# Code\n\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        int ans=0;\n        int n = words.size();\n        for(int i=0;i<n
\n# Code\n```\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        int ans=0;\n        int n = words.size();\n        for(int i=0;i<n;i++)\n        {\n            for(int j=i+1;j<n;j++)\n            {\n                bool flag = false;\n                for(int h = 0;h<26;h++)\n                {\n                    char ch = \'a\'+h;\n                    if(words[i].find(ch) == -1 && words[j].find(ch) != -1 || words[j].find(ch) == -1 && words[i].find(ch) != -1){\n                        flag = true;\n                        break;\n                    }\n                }\n                if(!flag)\n                    ans++;\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']