Python3 solution
This is the largest connected compent problem.\n```\nclass Solution:\n    def arrayNesting(self, nums: List[int]) -> int:\n        def dfs(node):\n            v
This is the largest connected compent problem.\n```\nclass Solution:\n    def arrayNesting(self, nums: List[int]) -> int:\n        def dfs(node):\n            visited.add(node)\n            this_group.add(node)\n            neigh = nums[node]\n            if neigh not in visited:\n                dfs(neigh)\n        \n        ans = 0\n        visited = set()\n        for node in range(len(nums)):\n            if node not in visited:\n                this_group = set()\n                dfs(node)\n                ans = max(ans, len(this_group))\n        return ans
['Depth-First Search', 'Recursion', 'Python3']