Return the least common multiple (LCM) of all numbers in nums: the smallest positive integer that every number divides evenly. The LCM of an empty list is 1.
Example 1
Input:
lcm_of_list([4, 6, 10])
Output:
60
60 is the smallest number that 4, 6 and 10 all divide.
Example 2
Input:
lcm_of_list([])
Output:
1
0 <= len(nums) <= 2001 <= nums[i] <= 10**12No results yet
Run your code to check it against the examples, or submit to run every test.