C++ with Explanation.
\n\nclass Solution {\npublic:\n    int longestPalindrome(vector<string>& words) {\n        int count_reverse=0;//our final answer\n        map<string,int>mp1;//
\n```\nclass Solution {\npublic:\n    int longestPalindrome(vector<string>& words) {\n        int count_reverse=0;//our final answer\n        map<string,int>mp1;//hashmap to count all strings having first character and second character different\n        map<string,int>mp;////hashmap to count all strings having first character and second character same\n\t\t//could have been done using only one hashmap but i did with 2 \n        for(int i=0;i<words.size();i++){\n            if(words[i][0]==words[i][1])\n                mp[words[i]]++;\n            else\n                mp1[words[i]]++;\n        }\n        for(auto i:mp1){\n            string s=i.first;//take a string having first and second chars different\n            reverse(s.begin(),s.end());\n            if(mp1.find(s)!=mp1.end()){//find if its reverse is in the map itself\n                count_reverse+=min(mp1[i.first],mp1[s])*4;//if it is then add minimum frequency\n\t\t\t\t//of original and reversed string multiplied by 4 to answer\n\t\t\t\t//let us say we have bx->3 and xb->7 so we form string bxbxbxxbxbxb which is length 12 i.e min(3,7)*4\n\t\t\t\t//then remove both of them from the map\n                mp1.erase(s);\n                mp1.erase(i.first);\n            }\n        }\n        int max1=0;//var to find max odd frequency of type-2(having both chars same) string\n\t\t//One example here: lets say we have [string]->count map as [aa]->2 [bb]->4 [cc]->6 so we can use all of them to make palindrome as they are all even frequency because we can balance them by placing one char at start and other char at end as they can be only of length 2\n\t\t//cccbbaabbccc=>palindrome string formed using above map\n\t\t//so we can say that all even frequency strings contribute to our answer fully.\n\t\t//also we are multiplying here by 2 instead of 4 as the string itself is palindrome here andits smallest length is 2\n        for(auto i:mp){\n            if(i.second%2==0){\n                count_reverse+=i.second*2;\n                mp[i.first]=0;\n            }\n        }\n\t\t//find max odd frequency\n        for(auto i:mp){\n            if(i.second%2)\n                max1=max(max1,i.second);\n        }\n\t\t//we can take it fully as palindrome has only one character with odd frequency\n        for(auto i:mp){\n            if(i.second==max1){\n                count_reverse+=i.second*2;\n                mp[i.first]=0;\n                break;\n            }\n        }\n\t\t//we can take all other odd frequencies which are left by making them even that is substracting one from them\n        for(auto i:mp){\n            if(i.second)\n                count_reverse+=2*(i.second-1);\n        }\n        return count_reverse;\n    }\n};\n```\nThank You. If anything still unclear you can comment i will fully try to solve your doubts and sorry for my bad english.
['C']