<doocs>1190.Reverse Substrings Between Each Pair of Parentheses_1.py
def reverseParentheses( s: str) -> str:
    stack = []
    for c in s:
        if c == ")":
            tmp = []
            while stack[-1] != "(":
                tmp += stack.pop()
            stack.pop()
            stack += tmp
        else:
            stack.append(c)
    return "".join(stack)
def sample_funcname ( var_0 : str ) -> str :
    var_2 = [ ]
    for var_3 in var_0 :
        if var_3 == ")" :
            var_5 = [ ]
            while var_2 [ - 1 ] != "(" :
                var_5 += var_2.pop ( )
            var_2.pop ( )
            var_2 += var_5
        else :
            var_2.append ( var_3 )
    return "".join ( var_2 )
