use delete_at instead of pop_at
This commit is contained in:
parent
89ae345ad6
commit
1a3c2bb7c9
1 changed files with 1 additions and 2 deletions
|
@ -21,8 +21,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.find_value(0..(length(report) - 1), false, fn dampen ->
|
||||||
{_, dampened} = List.pop_at(report, dampen)
|
report |> List.delete_at(dampen) |> check_report()
|
||||||
check_report(dampened)
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue