     overlapping_ids =
       map
       |> mark_map
-      |> Enum.map(&Kernel.elem(&1, 1))
       |> Enum.filter(&(Enum.count(&1) > 1))
       |> List.flatten()
       |> Enum.uniq()


  def mark_map(map) do
    Enum.reduce(map, Map.new(), &mark/2)
  end

  # here we finally we count all the pixels drawn more than once.

    input
    |> build_map
    |> mark_map
    |> Enum.filter(&(Enum.count(&1) > 1))
    |> Enum.count()
  end

