✅✅Best & Easy Solution in C++✅✅
Code\nPlease Upvote if it helps\uD83D\uDE42\n\nclass Solution {\npublic:\n    int longestPalindrome(vector<string>& words) {\n        int size=words.size(),coun
# Code\n**Please Upvote if it helps**\uD83D\uDE42\n```\nclass Solution {\npublic:\n    int longestPalindrome(vector<string>& words) {\n        int size=words.size(),count1=0,oddEven_occurrence=0;\n        bool check=false;\n        unordered_map<string,int> mp;\n        for(auto it:words)\n            mp[it]++;\n        for(auto it:mp){\n            string s=it.first;\n            if(s[0]!=s[1]){\n                string h=s;\n                reverse(h.begin(),h.end());\n                if(mp.find(h)!=mp.end()){\n                    count1 += 4*min(mp[s],mp[h]);\n                    mp.erase(h);\n                }\n            }\n            else{\n                if(it.second & 1){\n                    check=true;\n                    oddEven_occurrence+=it.second-1;\n                }\n                else\n                    oddEven_occurrence+=it.second;\n            }\n        }\n        if(count1 != 0){\n            if(check)\n                return count1 + oddEven_occurrence*2 + 2;\n            return count1 + oddEven_occurrence*2;\n        }\n        if(check)\n            return oddEven_occurrence*2 + 2;\n        return oddEven_occurrence*2;\n    }\n};\n```
['Array', 'Hash Table', 'String', 'Greedy', 'C++']