NeetCode #655LC-2709HardAdvanced GraphsNC 250
← Back to All Problems

#655 · #2709 · Greatest Common Divisor Traversal(最大公约数遍历)

📌 Problem Statement & Constraints

You are given a 0-indexed array nums. You may traverse from index i to index j if gcd(nums[i], nums[j]) > 1. Return whether there is a path visiting every index. Constraints: 1 <= nums.length <= 10^5, 1 <= nums[i] <= 10^5.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!