Valid Parentheses — a stack of openers
Push each opening bracket. A closing bracket must match the most recent unclosed opener — the top of the stack.
Try:
input
stack (top = right)