Using Hashing || Easy-Commented Code ✅✅
Guys consider upvoting! Thanks!\n# Code\n\nclass Solution {\npublic:\n    int maximumNumberOfStringPairs(vector<string>& words) {\n        int n  = words.size()
# Guys consider upvoting! Thanks!\n# Code\n```\nclass Solution {\npublic:\n    int maximumNumberOfStringPairs(vector<string>& words) {\n        int n  = words.size();\n        unordered_map<string, int> mp;\n        //add words to the map\n        for(int i = 0; i < n; i++){\n            mp[words[i]]++;\n        }\n        \n        int ans = 0;\n        for(int i = 0; i < n; i++){\n            string temp = words[i];\n            reverse(temp.begin(), temp.end());\n            // if reverse is present and is not equal (eg "zz")\n            if(words[i] != temp){\n                if(mp.count(temp) > 0){\n                    ans++;\n                    // reducing the count to remove duplicates\n                    mp[temp]--;\n                    mp[words[i]]--;\n                    // if count is zero we remove it\n                    if(mp[temp] == 0)\n                        mp.erase(temp);\n                    if(mp[words[i]] == 0)\n                        mp.erase(words[i]);\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['Hash Table', 'C++']