Problem 3¶
Compute a greatest common divisor (GCD) between two positive integers x
and y
.
Please note:
If
x
is greater-equaly
andx
is divisible byy
, the GCD betweenx
andy
isy
.Otherwise, the GCD between
x
andy
isGCD(y, x % y)
.
For x == 36
and y == 44
, the GCD is 4.
Do not use math.gcd
function.
Functions:
|
Compute the greatest common divisor (GCD) between |