Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
The greatest common divisor solution in Uncategorized category for The Greatest Common Divisor by capback250
# migrated from python 2.7
import math
def greatest_common_divisor(*args):
num = min(args)
n = []
for i in range(1, int(math.sqrt(num))+1):
if num % i == 0:
n.append(i)
n.append(num // i)
for i in sorted(n, reverse=True):
if all([x % i == 0 for x in args]):
return i
Sept. 9, 2015