This commit is contained in:
bluepython508
2023-12-08 14:08:39 +00:00
parent c500a9a280
commit 20501c0819
9 changed files with 72 additions and 2 deletions

View File

@@ -38,4 +38,7 @@ defmodule Aoc2023.Common do
def head([head | _]), do: head
def tail([_ | tail]), do: tail
def lcm(a, b), do: div(abs(a*b), Integer.gcd(a,b))
def lcm(ls), do: ls |> Enum.reduce(&lcm/2)
end