Anishluke92 / RubySolution

Problem solving using Ruby programming language
0 stars 1 forks source link

Recursion: GCD #13

Closed danielpaul closed 3 years ago

danielpaul commented 4 years ago

Write a function that calculates the GCD (Greatest Common Divisor) of two numbers recursively.

Examples

gcd(10, 20) ➞ 10

gcd(1, 3) ➞ 1

gcd(5, 7) ➞ 1

gcd(2, 6) ➞ 2 

Notes N/A