From 1a3c2bb7c9e777992c0f087298a27955624c081e Mon Sep 17 00:00:00 2001 From: Adam Millerchip Date: Mon, 2 Dec 2024 21:51:40 +0900 Subject: [PATCH] use delete_at instead of pop_at --- 2024/day2.exs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/2024/day2.exs b/2024/day2.exs index 26e9277..9262ad1 100755 --- a/2024/day2.exs +++ b/2024/day2.exs @@ -21,8 +21,7 @@ defmodule Day2 do def part2(reports) do Enum.count(reports, fn report -> Enum.find_value(0..(length(report) - 1), false, fn dampen -> - {_, dampened} = List.pop_at(report, dampen) - check_report(dampened) + report |> List.delete_at(dampen) |> check_report() end) end) end