Problems > Coprime or Not > Editorial

Coprime or Not — Solution & Editorial

Back to the Problem

Compute the gcd with Euclid's algorithm and compare with 1.

Complexity: O(log min(A, B))