re: Daily Challenge #35 - Find the Outlier VIEW POST

FULL DISCUSSION
 

Elixir:

defmodule Outlier do
  require Integer

  def find(list) do
    if list
       |> Enum.take(3)
       |> Enum.filter(&Integer.is_even/1)
       |> Enum.count() == 1,
       do: Enum.find(list, &Integer.is_even/1),
       else: Enum.find(list, &Integer.is_odd/1)
  end
end
code of conduct - report abuse