Elixir Palindrome Rearranging
defmodule PalindromeRearranging do
def palindrome_rearranging(input_string) do
input_string
|> String.graphemes()
|> Enum.frequencies()
|> Map.values()
|> Enum.count(&(rem(&1, 2) != 0))
|> Kernel.<=(1)
end
end
This counts character frequency and checks whether the string has the right number of odd counts to form a palindrome.