Search
⌘K

Leetcode 2709. Greatest Common Divisor Traversal

Determine whether the graph on array indices with an edge between i and j iff gcd(nums[i], nums[j]) > 1 is fully connected. With nums and n up to 1e5 the core challenge is efficiently checking connectivity (typically via union-find over shared prime factors rather than O(n^2) pairwise gcds).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.