4 ms·
For the gcd, I've always liked this version from python's own unit test: def gcd(a, b): while a: a, b = b%a, a return b
by bayareaguy 19y ago
For the gcd, I've always liked this version from python's own unit test:
def gcd(a, b):
while a:
a, b = b%a, a
return b