Solving Largest Component Size by Common Factor in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Return the size of the largest connected component in the graph.

Example 1:

Input: [4,6,15,35]
Output: 4

Example 2:

Input: [20,50,9,63]
Output: 2

Example 3:

Input: [2,3,6,7,4,12,21,39]
Output: 8

Note:

  1. 1 <= A.length <= 20000

  2. 1 <= A[i] <= 100000

  3. 1 <= A.length <= 20000

  4. 1 <= A[i] <= 100000

See the full details of the problem Largest Component Size by Common Factor at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go