Workspace

Algorithms

3 day streakD
THE BUILDING BLOCKS

A few patterns. A lot of possibilities.

Understand the idea first. The right solution starts to look familiar.

01Start here

Hash map lookup

Trade a little space for fast lookups. Great for counting, grouping, and finding pairs.

02Essential

Two pointers

Move inward from both ends, or move two pointers at different speeds.

03Essential

Binary search

Use a sorted range and halve the possibilities with each comparison.

04Popular

Sliding window

Maintain a useful slice of your input as its left and right boundaries move.

05Next step

Monotonic stack

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

06Essential

Depth-first search

Follow one branch at a time. Recursion makes the repeated work feel natural.

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