Given 2 non-negative integers A and B, find gcd(A, B).Problem Constraints
GCD of 2 integers m and n is defined as the greatest integer g such that g is a divisor of both m and n.
Both A and B fit in a 32-bit signed integer.
NOTE: DO NOT USE LIBRARY FUNCTIONS
0 <= A <= 109Input Format
0 <= B <= 109
The first argument is an integer A.Output Format
The second argument is an integer B.
Return the Greatest Common Divisor of A and BExample Input
3 is the GCD of 6 and 9
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified.
Still have a question? Checkout Sample Codes for more details.