<doocs>2401.Longest Nice Subarray_1.py
def longestNiceSubarray( nums: List[int]) -> int:
    ans = j = t = 0
    for i, v in enumerate(nums):
        while t & v:
            t ^= nums[j]
            j += 1
        t |= v
        ans = max(ans, i - j + 1)
    return ans
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_6 = var_3 = var_4 = 0
    for var_8 , var_9 in enumerate ( var_0 ) :
        while var_4 & var_9 :
            var_4 ^= var_0 [ var_3 ]
            var_3 += 1
        var_4 |= var_9
        var_6 = max ( var_6 , var_8 - var_3 + 1 )
    return var_6
