Search
⌘K

Leetcode 952. Largest Component Size by Common Factor

Given unique positive integers, build a graph connecting numbers that share a common factor >1 and return the size of the largest connected component — this is typically solved by factorizing each number and using union-find (or grouping) over prime factors to efficiently cluster numbers (nums.length ≤ 2e4, nums[i] ≤ 1e5).


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.