Day 10
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user