Easy C++ Solution | Map
Code\n\nclass Solution {\npublic:\n    int maximumNumberOfStringPairs(vector<string>& words) {\n        unordered_map<string, int> mp;\n        int cnt = 0;\n  
# Code\n```\nclass Solution {\npublic:\n    int maximumNumberOfStringPairs(vector<string>& words) {\n        unordered_map<string, int> mp;\n        int cnt = 0;\n        for(int i=0;i<words.size();i++) {\n            if(mp.find(words[i]) != mp.end()) {\n                cnt++;\n                mp.erase(words[i]);\n            } else {\n                swap(words[i][0], words[i][1]);\n                mp[words[i]]++;\n            }\n        }\n        return cnt;\n    }\n};\n```
['C++']