Short Python
Basically this problem means find the biggest cycle. One thing we shall notice is once i has been visited in previous different cycle, it must not in current cy
Basically this problem means find the biggest cycle. One thing we shall notice is once ```i``` has been visited in previous different cycle, it must **not** in current cycle and we can ignore it.\n```\nclass Solution(object):\n    def arrayNesting(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        ans, step, n = 0, 0, len(nums)\n        seen = [False] * n\n        for i in range(n):\n            while not seen[i]:\n                seen[i] = True\n                i, step = nums[i], step + 1\n            ans = max(ans, step)\n            step = 0\n        return ans\n```
[]