C++ Easy and simple solution Brute Force Approach
Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F\nFoll
***Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F***<br>\n**Follow me on LinkeDin [[click Here](https://www.linkedin.com/in/ayushluthra62/)]**\n# Complexity\n- Time complexity:\nO(N* N *N)\n\n- Space complexity:\nO(N)\n\n# Code\n```\nclass Solution {\npublic:\n    int similarPairs(vector<string>& words) {\n        int count=0;\n        for(int i=0;i<words.size();i++){\n            vector<int>mapping1(26,0);\n            for(auto b : words[i]){\n                mapping1[b-\'a\']++;\n            }\n            \n            for(int j=i+1;j<words.size();j++){\n                vector<int>mapping2(26,0);\n                for(auto k:words[j]){\n                    mapping2[k-\'a\']++;\n                }\n                bool equal=true;\n                for(int k=0;k<mapping1.size();k++){\n                    if((mapping1[k]!=0 && mapping2[k]==0) || (mapping1[k]==0 && mapping2[k]!=0) ){\n                        equal=false;\n                        break;\n                    }\n                }\n\n            if(equal) count++;\n            \n            }\n            \n        }\n        return count;\n    }\n};\n```\n***Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F***<br>\n**Follow me on LinkeDin [[click Here](https://www.linkedin.com/in/ayushluthra62/)]**
['C++']