4 ms·
Code doesn't have to look like that, look at the Haskell version: gcd x y | x == y = x | x > y = gcd (x - y) y | otherwise = gcd x (y
by Apaec 8y ago
Code doesn't have to look like that, look at the Haskell version:
gcd x y | x == y = x
| x > y = gcd (x - y) y
| otherwise = gcd x (y - x)
Much more close to the math notation.