easy peasy python O(n), comments, set
\tdef longestConsecutive(self, nums: List[int]) -> int:\n        # for each num I will check whether num-1 exists\n        # if yes, then I ignore this num\n   
\tdef longestConsecutive(self, nums: List[int]) -> int:\n        # for each num I will check whether num-1 exists\n        # if yes, then I ignore this num\n        # Otherwise if num-1 doesn\'t exist, then I will go till I can find num+1\n        # so in a way I am only checking each number max once and once in set.\n        \n        st = set(nums)    \n        mx = 0\n        for num in nums:\n            if num-1 not in st:\n                tmp = 1\n                while num+1 in st:\n                    tmp += 1\n                    num += 1\n                mx = max(mx, tmp)\n       \n        return mx
['Python', 'Python3']