Get greatest common divisor
a - First number b - Second number Returns GCD of the two numbers
a
b
static int gcd(int a, int b) { while (b != 0) { final temp = b; b = a % b; a = temp; } return a; }