Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Greatest Common Divisor by tokiojapan55
def gdc(a, b):
r = a % b
while r != 0:
a, b = b, r
r = a % b
return b
def greatest_common_divisor(*args):
target = sorted(args, reverse=True)
while len(target) > 1:
target = [gdc(target[0], target[1])] + target[2:]
return target[0]
June 17, 2020
Comments: