<doocs>1963.Minimum Number of Swaps to Make the String Balanced_1.py
def minSwaps( s: str) -> int:
    ans = 0
    for c in s:
        if c == '[':
            ans += 1
        elif ans:
            ans -= 1
    return (ans + 1) >> 1
def sample_funcname ( var_0 : str ) -> int :
    var_4 = 0
    for var_5 in var_0 :
        if var_5 == '[' :
            var_4 += 1
        elif var_4 :
            var_4 -= 1
    return ( var_4 + 1 ) >> 1
