扫完之后栈里剩几个
运行下面这段程序:
st = []
for ch in "(()":
if ch == "(":
st.append(ch)
else:
st.pop()
print(len(st))
运行下面这段程序:
st = []
for ch in "(()":
if ch == "(":
st.append(ch)
else:
st.pop()
print(len(st))
全部评论