gcd
Calculates the greatest common divisor between two or more numbers/arrays.
- The inner
_gcdfunction uses recursion. - Base case is when
yequals0. In this case, returnx. - Otherwise, return the GCD of
yand the remainder of the divisionx/y.
Calculates the greatest common divisor between two or more numbers/arrays.
_gcd function uses recursion.y equals 0. In this case, return x.y and the remainder of the division x/y.