Very simple and easy understanding solution / Big O
Please, upvote this post\n\nO(n) Space\nO(n) Time\n\n\nvar longestPalindrome = function(words) {\n    const map = {}, rev = el => el.split(\'\').reverse().join(
**Please, upvote this post**\n\nO(n) Space\nO(n) Time\n\n```\nvar longestPalindrome = function(words) {\n    const map = {}, rev = el => el.split(\'\').reverse().join(\'\')\n    let max = 0\n    for (let word of words) {\n        if (map[word]) {\n            max += 4\n            map[word]--\n        } else {\n            const revWord = rev(word)\n            map[revWord] ? map[revWord]++ : map[revWord] = 1\n        }\n    }\n    if (Object.keys(map).filter(el => map[el] && el === rev(el)).length) max += 2\n    return max\n};\n```\n![image](https://assets.leetcode.com/users/images/d1f7eac9-8c73-477e-bf6f-b418d66b1b18_1660669841.782181.png)
['JavaScript']