Skip to main content

๐ŸŽฎ Stacks & Queues (Practice)

Companion to the Stacks & Queues guide. Watch a stack validate balanced brackets, then implement the check.

๐ŸŽฌ Watch it workโ€‹

Valid Parentheses โ€” push opens, pop on matchStep 1 / 7
1
2
3
3
2
1
'(' opens โ†’ push. Stack: (

๐Ÿ Your turnโ€‹

Loading editorโ€ฆ

๐Ÿง  Challenge yourselfโ€‹

  1. Return the index of the first unmatched bracket.
  2. Implement a queue using two stacks.
  3. Min-stack: support push/pop/getMin all in O(1).

Continue the path โ†’ Heaps & Priority Queues