c++ | easy | short
\n\n# Code\n\n#define n 26\n\nclass Solution {\npublic:\n    Solution() {\n        ios_base::sync_with_stdio(0);\n    }\n    \n    int longestPalindrome(vector<
\n\n# Code\n```\n#define n 26\n\nclass Solution {\npublic:\n    Solution() {\n        ios_base::sync_with_stdio(0);\n    }\n    \n    int longestPalindrome(vector<string>& words) {\n        int len = 0, arr[n][n] = { 0 };\n        for (string& s : words) {\n            if (!arr[s.front() - \'a\'][s.back() - \'a\']) ++arr[s.back() - \'a\'][s.front() - \'a\'];\n            else len += 4, --arr[s.front() - \'a\'][s.back() - \'a\'];\n        }\n        for (int i = 0; i < n; ++i) if (arr[i][i] & 1) {\n            len += 2;\n            break;\n        }\n        return len;\n    }\n};\n```
['C++']