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 Talim42
def greatest_common_divisor(*args):
"""euclidean alorithm for finding gcd for any number of numbers"""
while len(args) > 1:
min_arg = min(args)
args = {arg % min_arg for arg in args if arg % min_arg} | {min_arg}
return min(args)
Sept. 22, 2014
Comments: