Write a function that calculates the *least common multiple* of its arguments; each argument is assumed to be a non-negative integer. In the case that there are no arguments (or the provided array in compiled languages is empty), return `1`.

~~~if:objc
NOTE: The first (and only named) argument of the function `n` specifies the number of arguments in the variable-argument list. Do **not** take `n` into account when computing the LCM of the numbers.
~~~

Source: codewars | Difficulty: EASY
Tags: Mathematics

Starter code: def lcm(*args):
	

Solutions:
from functools import reduce

def lcm(*args):
	return reduce(lcms, args) if args else 1

def gcd(a, b):
	return b if a == 0 else gcd(b % a, a)

def lcms(a, b):
	return a * b // gcd(a, b)


from math import gcd
from functools import reduce

def lcm(*args):
	return reduce(lambda x, y: abs(x * y) // gcd(x, y), args) if args else 1


from fractions import gcd

def lcm(*args):
	m = 1
	for i in args:
		if i == 0:
			return 0
		m = m * i / gcd(m, i)
	return m