Skip to content

Instantly share code, notes, and snippets.

@SharanSMenon
Created April 21, 2018 17:09
Show Gist options
  • Save SharanSMenon/86b66d22b74e330046c91a3a12fa4045 to your computer and use it in GitHub Desktop.
Save SharanSMenon/86b66d22b74e330046c91a3a12fa4045 to your computer and use it in GitHub Desktop.
def gcd(a, b):
"""
An efficient algorithm to compute GCD \n
a is a number \n
b is the other number \n
no other arguments
"""
if b == 0:
return a
ap = a % b
return gcd(b, ap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment