C++ || Easy with Comments
\nclass Solution {\npublic:\n    int longestPalindrome(vector<string>& words) {\n        int count=0;\n        //Create map and count all words frequency\n     
```\nclass Solution {\npublic:\n    int longestPalindrome(vector<string>& words) {\n        int count=0;\n        //Create map and count all words frequency\n        map<string,int> m;\n        for(auto w:words) {\n            m[w]++;\n        }\n        \n        //if single word like gg once done then not consider second time\n        //ex. cd*gg*dc\n        bool flag=false;\n        for(auto x:words) {\n            string w=x;\n            reverse(w.begin(),w.end());\n            //Encounter bc and cb then both freq -- by 1\n            if(w!=x and m[x]>0 and m[w]>0) {\n                m[x]--;\n                m[w]--;\n                count+=4;\n            } //Encounter aa and aa 2 times like bc*aa aa*cb,-- by 2 times\n            else if(w==x and m[x]>1) {\n                m[x]-=2;\n                count+=4;\n            } //Consider once like, bc*gg*cb\n            else if(w==x and !flag and m[x]>0) {\n                m[x]--;\n                count+=2;\n                flag=true;\n            }\n        }\n        return count;\n        \n    }\n};\n```
[]