Greatest Common Divisor
EasyMath
Description
Given two positive integers a and b, return their greatest common divisor.
Examples
Input:
a = 12, b = 18Output:
6Explanation:
The greatest number dividing both 12 and 18 evenly is 6.
Input:
a = 7, b = 13Output:
1Explanation:
The greatest number dividing both 7 and 13 evenly is 1.
Input:
a = 100, b = 75Output:
25Explanation:
The greatest number dividing both 100 and 75 evenly is 25.
Constraints
- •
1 ≤ a, b ≤ 10⁹