c++ solution
\n\nclass Solution {\npublic:\n    unordered_map<string, int> mp;\n    int longestPalindrome(vector<string>&v) \n    {\n        int n=v.size();\n        int m=2
```\n\nclass Solution {\npublic:\n    unordered_map<string, int> mp;\n    int longestPalindrome(vector<string>&v) \n    {\n        int n=v.size();\n        int m=2;\n        int ans=0;\n        // even case\n\tfor (int i = 0; i <n; i++) {\n\t\tstring str=v[i];\n\t\tstring b(str);\n\t\treverse(b.begin(), b.end());\n\t\tif (mp[b]) {\n\t\t\tmp[b]--, ans += 2*m;\n\t\t\tcontinue;\n\t\t}\n\t\telse mp[str]++;\n\t}\n        //odd case\n\tfor (auto &v : mp) {\n\t\tif (!v.second) continue;\n\t\tstring b(v.first);\n\t\treverse(b.begin(), b.end());\n\t\tif (b == v.first) {\n\t\t\tans += m;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ans;\n    }\n};\n```
['C', 'C++']