[Ruby] 1-liner, Bit Magic
ruby\ndef longest_palindrome(s) =\n    [s.size, s.each_char.tally.sum { _2 & ~1 } + 1].min\n\nruby\ndef longest_palindrome(s) =\n    s.each_char.tally.reduce(0)
```ruby\ndef longest_palindrome(s) =\n    [s.size, s.each_char.tally.sum { _2 & ~1 } + 1].min\n```\n```ruby\ndef longest_palindrome(s) =\n    s.each_char.tally.reduce(0) do | r, (_, v) |\n        r + (v & ~1) | v & 1\n    end\n```
['Ruby']