From 1cfe6e2f3467057086e3aadd3a7dbe48d969f238 Mon Sep 17 00:00:00 2001 From: Adam Millerchip Date: Tue, 3 Dec 2024 09:59:23 +0900 Subject: [PATCH] Use Enum.any?/2 instead of Enum.find_value/3 --- 2024/day2.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024/day2.exs b/2024/day2.exs index 9262ad1..0faa0e7 100755 --- a/2024/day2.exs +++ b/2024/day2.exs @@ -20,7 +20,7 @@ defmodule Day2 do def part2(reports) do 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() end) end)