Back to Dashboard

Pro pattern

Upgrade to Pro to access this pattern and all 22 patterns.

Upgrade
PATTERN

Stacks & Monotonic Stacks

Use LIFO ordering to match pairs, track state, and evaluate expressions. Monotonic stacks extend the idea to efficiently find the next greater or smaller element in O(n) time.

Learn Stacks & Monotonic StacksExplanation, templates & reference

Valid Parentheses

easy

Min Stack

medium

Evaluate Reverse Polish Notation

medium

Daily Temperatures

medium

Car Fleet

medium

Largest Rectangle in Histogram

hard