Golang O(N) Explained
\nfunc longestPalindrome(words []string) int {\n    n := len(words)\n    count := make(map[string]int, n)\n    length := 0\n\t\n\t// for every word that has its
```\nfunc longestPalindrome(words []string) int {\n    n := len(words)\n    count := make(map[string]int, n)\n    length := 0\n\t\n\t// for every word that has its corresponding reversed word, it will definitely be included in the final palindrome length\n    for _, word := range words {\n        reversed := reverse(word)\n        if v, ok := count[reversed]; ok {\n            length += 4\n            if v == 1 {\n                delete(count, reversed)\n            } else {\n                count[reversed]--\n            }\n        } else {\n            count[word]++\n        }\n    }\n    \n\t// among unused words, if there is a word with the same letters, we can add it to the final palindrome length\n    for word, _ := range count {\n        if isPair(word) {\n            length += 2\n            break\n        }\n    }\n    \n    return length\n}\n\nfunc reverse(s string) string {\n    ss := make([]byte, 2)\n    ss[0], ss[1] = s[1], s[0]\n    return string(ss)\n}\n\nfunc isPair(s string) bool {\n    return s[0] == s[1]\n}\n```
['Go']