This commit is contained in:
bluepython508
2023-12-10 17:24:56 +00:00
parent 1655ead021
commit 5c04d2651e
13 changed files with 142 additions and 0 deletions

View File

@@ -41,4 +41,8 @@ defmodule Aoc2023.Common do
def lcm(a, b), do: div(abs(a*b), Integer.gcd(a,b))
def lcm(ls), do: ls |> Enum.reduce(&lcm/2)
def list_map_at(l, n, f) do
List.replace_at(l, n, f.(Enum.at(l, n)))
end
end