Use Enum.any?/2 instead of Enum.find_value/3
This commit is contained in:
parent
1a3c2bb7c9
commit
1cfe6e2f34
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue