<doocs>1111.Maximum Nesting Depth of Two Valid Parentheses Strings_1.py
def maxDepthAfterSplit( seq: str) -> List[int]:
    ans = [0] * len(seq)
    a = b = 0
    for i, c in enumerate(seq):
        if c == "(":
            if a < b:
                a += 1
            else:
                b += 1
                ans[i] = 1
        else:
            if a > b:
                a -= 1
            else:
                b -= 1
                ans[i] = 1
    return ans
def sample_funcname ( var_0 : str ) -> List [ int ] :
    var_6 = [ 0 ] * len ( var_0 )
    var_8 = var_7 = 0
    for var_10 , var_11 in enumerate ( var_0 ) :
        if var_11 == "(" :
            if var_8 < var_7 :
                var_8 += 1
            else :
                var_7 += 1
                var_6 [ var_10 ] = 1
        else :
            if var_8 > var_7 :
                var_8 -= 1
            else :
                var_7 -= 1
                var_6 [ var_10 ] = 1
    return var_6
