defmodule Main do def main do IO.gets("") |> String.trim |> String.split |> Enum.map(&String.to_integer/1) |> Enum.group_by(fn x -> x end) |> Enum.map(fn {_, value} -> Enum.count(value) end) |> judge |> IO.puts end def judge([3,2]), do: "FULL HOUSE" def judge([3,1,1]), do: "THREE CARD" def judge([2,2,1]), do: "TWO PAIR" def judge([2,1,1,1]), do: "ONE PAIR" def judge(_), do: "NO HAND" end