All problems
MediumAlgorithms
GCD (Euclid)
Implement gcd(a, b) using Euclid's algorithm.
- #math
- #recursion
Sample input
48, 18
Sample output
6
gcd-euclid.py
Output
Press "Run code" to execute.
Loading…
Implement gcd(a, b) using Euclid's algorithm.
48, 18
6
Press "Run code" to execute.