[Python] Solution Explained - Array Nesting
Explaination:\n        given :  unique array of nums\n        return : length of longest set.\n        problem: \n        \n        indx 0 1 2 3 4 5 6\n        
Explaination:\n        given :  unique array of nums\n        return : length of longest set.\n        problem: \n        \n        indx 0 1 2 3 4 5 6\n        eg : 5 4 0 3 1 6 2\n \n        index choosen = 0\n        nums[0] = 5,nums[5] = 6,nums[6] = 2 nums[2]= 0 nums[0]=5\u274C  \n        length = 4\n        \n        index choosen = 1\n        nums[1] = 4,nums[4] = 1,nums[1]=4\u274C\n        length=2\n        \n        index choosen = 2\n        nums[2]=0,nums[0]=5,nums[5]=6,nums[6]=2,nums[2]=0\n        length=4\n        \n        index choosen = 3\n        nums[3] = 3\n\t\tby observing we can note that cycles are being fromed so we can have an array to just track if this index is visited earlier \n\t\tor not .If it is visited earlier it means it was part of some cycle and there is no point in choosing it now because we will end up        in the same loop (you can see the example when index choosen is=0 and index choosen=2)\nCode:\n```\nclass Solution:\n    def arrayNesting(self, nums: List[int]) -> int:   \n        i = 0\n        max_count = 0\n        check = [False] * (len(nums))\n        while i< len(nums):\n            if check[i] == False:\n                temp_set = set()\n                while i not in temp_set:\n                    temp_set.add(i)\n                    check[i] = True\n                    i = nums[i]\n                max_count = max(max_count,len(temp_set))\n            i += 1\n        return max_count\n```\nT.C : O(n)
['Python', 'Python3']