use Map.reject

This commit is contained in:
Adam Millerchip 2022-11-29 21:42:55 +09:00
parent fb87183a6f
commit 32679a526a

View file

@ -45,7 +45,7 @@ defmodule Day9 do
end end
defp remove_nines(cave) do defp remove_nines(cave) do
floor = cave.floor |> Enum.reject(&match?({_k, 9}, &1)) |> Map.new() floor = Map.reject(cave.floor, &match?({_k, 9}, &1))
%Cave{cave | floor: floor} %Cave{cave | floor: floor}
end end