Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,22 @@
def gcd(a, b)
if (a < 1) or (b < 1)
throw new(InvalidNumberException, "gcd cannot be calculated on values < 1")
end
c = 0
while b != 0
c = a
a = b
b = c % b
end
return a
end
def lcm(m, n)
return (m * n) / gcd(m, n)
end
println lcm(12, 18)
println lcm(6, 14)
println lcm(1,2) = lcm(2,1)