Approach hintTry it first, then revealHide
Push opening brackets; each closing bracket must match the bracket on top of the stack. The string is valid only if the stack is empty at the end.
Push opening brackets; each closing bracket must match the bracket on top of the stack. The string is valid only if the stack is empty at the end.