<doocs>0128.Longest Consecutive Sequence_1.py
def longestConsecutive( nums: List[int]) -> int:
    s, res = set(nums), 0
    for num in nums:
        if num - 1 not in s:
            t, next = 1, num + 1
            while next in s:
                t, next = t + 1, next + 1
            res = max(res, t)
    return res
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_4 , var_6 = set ( var_0 ) , 0
    for var_7 in var_0 :
        if var_7 - 1 not in var_4 :
            var_9 , var_10 = 1 , var_7 + 1
            while var_10 in var_4 :
                var_9 , var_10 = var_9 + 1 , var_10 + 1
            var_6 = max ( var_6 , var_9 )
    return var_6
