Skip to content
core-pattern

Stacks

Use LIFO state for nesting, parsing, simulation, path simplification, and deferred work.

Problems

Problems in Stacks

Practice problems that share this primary solution pattern and compare the clues that reveal it.

Detailed view of a computer screen displaying code with a menu of AI actions, illustrating modern software development.
beginner
9 min read

Valid Parentheses

Counting brackets tells you how many openings and closings exist. A stack tells you whether they close in the only order that nesting allows.

View solution
Group of teenagers using a vending machine in a school corridor, captured in ambient lighting.
intermediate
9 min read

Simplify Path

Treating this as string cleanup is how you lose the problem. Removing every dot breaks valid names such as ..., while careless parent handling can let /../…

View solution