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:
← Prev
Next →
▶ Play
Reset
input
stack (top = right)