def helper(s): pre_sign = '+' num = 0 stack = [] while s: v = s[0] s.pop(0) if v.isdigit(): num = num*10 + int(v) if v in ['(', '[', '{']: num = helper(s) if not v.isdigit() or len(s)==0: if pre_sign == ...