Use Enum.any?/2 instead of Enum.find_value/3

This commit is contained in:
Adam Millerchip 2024-12-03 09:59:23 +09:00
parent 1a3c2bb7c9
commit 1cfe6e2f34

View file

@ -20,7 +20,7 @@ defmodule Day2 do
def part2(reports) do def part2(reports) do
Enum.count(reports, fn report -> Enum.count(reports, fn report ->
Enum.find_value(0..(length(report) - 1), false, fn dampen -> Enum.any?(0..(length(report) - 1), fn dampen ->
report |> List.delete_at(dampen) |> check_report() report |> List.delete_at(dampen) |> check_report()
end) end)
end) end)