The Greatest Common Divisor of a group of numbers is the greatest positive integer that can divide all the numbers in the group without a reminder.
Euclid’s algorithm to find GCD
def gcd(a, b):
if(a == 0):
return b
return gcd(b%a, a)
The Greatest Common Divisor of a group of numbers is the greatest positive integer that can divide all the numbers in the group without a reminder.
def gcd(a, b):
if(a == 0):
return b
return gcd(b%a, a)