Accepted C# DSU Solution
\n    public class Solution\n    {\n        private class Unions\n        {\n            private readonly int[] _parents;\n            private readonly int[] _r
```\n    public class Solution\n    {\n        private class Unions\n        {\n            private readonly int[] _parents;\n            private readonly int[] _ranks;\n\n            public Unions(int n)\n            {\n                _parents = new int[n];\n                _ranks = new int[n];\n                for (int i = 0; i < n; i++)\n                {\n                    _parents[i] = i;\n                }\n            }\n\n            public int Find(int x)\n            {\n                if (x != _parents[x])\n                {\n                    x = Find(_parents[x]);\n                }\n                return _parents[x];\n            }\n\n            public bool Union(int x, int y)\n            {\n                int px = Find(x);\n                int py = Find(y);\n                if (px == py)\n                {\n                    return false;\n                }\n                if (_ranks[px] > _ranks[py])\n                {\n                    _parents[py] = px;\n                    _ranks[px]++;\n                }\n                else\n                {\n                    _parents[px] = py;\n                    _ranks[py]++;\n                }\n                return true;\n            }\n        }\n\n        public int LargestComponentSize(int[] nums)\n        {\n            IDictionary<int, int> factor2Root = new Dictionary<int, int>();\n            Unions dsu = new Unions(nums.Length);\n\n            for (int i = 0; i < nums.Length; i++)\n            {\n                int currentNum = nums[i];\n\n                int factor = 2;\n                while (factor * factor <= currentNum)\n                {\n                    if (currentNum % factor != 0)\n                    {\n                        factor++;\n                        continue;\n                    }\n\n                    if (factor2Root.ContainsKey(factor))\n                    {\n                        dsu.Union(i, factor2Root[factor]);\n                    }\n\n                    factor2Root[factor] = dsu.Find(i);\n\n                    while (currentNum % factor == 0)\n                    {\n                        currentNum /= factor;\n                    }\n\n                    factor++;\n                }\n\n\n                if (factor2Root.ContainsKey(nums[i]))\n                {\n                    dsu.Union(i, factor2Root[nums[i]]);\n                }\n                factor2Root[nums[i]] = dsu.Find(i);\n\n\n\n                if (currentNum != 1)\n                {\n                    if (factor2Root.ContainsKey(currentNum))\n                    {\n                        dsu.Union(i, factor2Root[currentNum]);\n                    }\n                    factor2Root[currentNum] = dsu.Find(i);\n                }\n            }\n\n            IDictionary<int, int> roots2Count = new Dictionary<int, int>();\n            for (int i = 0; i < nums.Length; i++)\n            {\n                var r = dsu.Find(i);\n                if (!roots2Count.ContainsKey(r))\n                {\n                    roots2Count[r] = 0;\n                }\n\n                roots2Count[r]++;\n            }\n\n\n            return roots2Count.Values.Max();\n        }\n    }\n```
['Union Find']