We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
from Volume 2. Data Structures :: Lists
输入一个只含有 ‘(’ 、‘)’ 、‘[’ 、‘]’ 的序列,判断并输出括号是否匹配。
经典的括号匹配问题,用一个栈来存放括号。左括号则入栈,右括号则出栈。匹配会有几种情况:
分别对应括号出入栈时的几种情况: