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