Workspace

Stacks

3 day streakD
All algorithms
INTERMEDIATE · 3 PRACTICE PROBLEMS

Stacks

Build intuition, one layer at a time.

Learn the pattern Put it into practice
THE CORE IDEA

Monotonic stack

Keep elements in order to find the next greater or smaller value in one pass.

O(n)

A good place to practice

Start simple, then build up to the next challenge.

3 problems
SolvedProblemDifficultyTopicAcceptanceBookmark
Valid ParenthesesEasyStacks42.3%
Daily TemperaturesMediumStacks67.9%
Min StackMediumStacks56.4%

A good place to start

Explore a pattern

A little guidance

Start with a pattern, read through a problem, and mark it solved when the idea clicks. Save anything you want to revisit.

This preview uses sample content. Your bookmarks and solved checkmarks stay in this browser.

Explore the roadmap