Skip to content

Instantly share code, notes, and snippets.

@Arnauld
Created Aug 27, 2019
Embed
What would you like to do?
private static int gcd(int a, int b) {
BigInteger b1 = BigInteger.valueOf(a);
BigInteger b2 = BigInteger.valueOf(b);
BigInteger gcd = b1.gcd(b2);
return gcd.intValue();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment