<doocs>0003.Longest Substring Without Repeating Characters_1.py
def lengthOfLongestSubstring( s: str) -> int:
    ss = set()
    i = ans = 0
    for j, c in enumerate(s):
        while c in ss:
            ss.remove(s[i])
            i += 1
        ss.add(c)
        ans = max(ans, j - i + 1)
    return ans
def sample_funcname ( var_0 : str ) -> int :
    var_4 = set ( )
    var_7 = var_5 = 0
    for var_9 , var_10 in enumerate ( var_0 ) :
        while var_10 in var_4 :
            var_4.remove ( var_0 [ var_7 ] )
            var_7 += 1
        var_4.add ( var_10 )
        var_5 = max ( var_5 , var_9 - var_7 + 1 )
    return var_5
