LeetCodechevron_rightCategorieschevron_rightmonotonic stack
trending_up

monotonic stack

54 problems
Easy: 2Medium: 29Hard: 23

monotonic stack is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

Problem bank

monotonic stack problem bank

Start with a compact scan-friendly list and progressively load more so the topic page stays readable even when the corpus is large.

Progressive topic library

Built for large topic sets: scan the structure first, then go deeper.

hourglass_bottomScroll to continue
search
tuneDifficulty

Showing 24 / 54 problems

+24 per load
#TitleDifficulty
42

Trapping Rain Water

Calculate the total trapped rain water using the elevation map array, leveraging dynamic programming and two-pointer pat…

Hard
84

Largest Rectangle in Histogram

Find the maximal rectangular area in a histogram using stack-based state management for precise bar tracking and width c…

Hard
85

Maximal Rectangle

Compute the largest rectangle of 1's in a binary matrix using dynamic programming and stack-based state transitions effi…

Hard
316

Remove Duplicate Letters

Remove duplicate letters from a string to produce the lexicographically smallest result using stack-based state manageme…

Medium
321

Create Maximum Number

Create Maximum Number involves merging digits from two arrays while preserving order, maximizing the resulting number.

Hard
402

Remove K Digits

Remove K Digits requires selecting which digits to drop using a monotonic stack for the smallest possible integer result…

Medium
456

132 Pattern

Identify whether a given integer array contains a 132 pattern subsequence using efficient stack and search techniques.

Medium
496

Next Greater Element I

Find the next greater element for each number in nums1 from the nums2 array using an optimized approach.

Easy
503

Next Greater Element II

Solve the Next Greater Element II problem by using a stack-based state management approach for circular arrays.

Medium
581

Shortest Unsorted Continuous Subarray

Find the shortest unsorted continuous subarray that, if sorted, would sort the entire array.

Medium
654

Maximum Binary Tree

Construct a maximum binary tree by recursively selecting the largest element and dividing the array into left and right …

Medium
739

Daily Temperatures

In the Daily Temperatures problem, you need to find out how many days to wait for a warmer temperature based on given da…

Medium
768

Max Chunks To Make Sorted II

Determine the maximum number of chunks you can split an array into so that sorting each chunk results in a fully sorted …

Hard
769

Max Chunks To Make Sorted

The Max Chunks To Make Sorted problem requires you to split an array into the maximum number of chunks that can be sorte…

Medium
853

Car Fleet

The Car Fleet problem asks how many car fleets will reach a target given their starting positions and speeds, considerin…

Medium
901

Online Stock Span

Design an efficient algorithm using stacks to calculate the stock span for daily price quotes.

Medium
907

Sum of Subarray Minimums

Calculate the sum of minimum values across all subarrays of a given array modulo 10^9 + 7.

Medium
962

Maximum Width Ramp

Find the maximum width of a ramp where nums[i] <= nums[j] for i < j using a two-pointer approach.

Medium
975

Odd Even Jump

Determine the number of valid starting indices in an array where you can reach the end with alternating odd and even jum…

Hard
1008

Construct Binary Search Tree from Preorder Traversal

Construct a binary search tree directly from a preorder traversal array using stack-based state tracking efficiently.

Medium
1019

Next Greater Node In Linked List

Find the next greater value for each node in a linked list using monotonic stack techniques for efficient traversal.

Medium
1081

Smallest Subsequence of Distinct Characters

The Smallest Subsequence of Distinct Characters problem asks you to find the lexicographically smallest subsequence of a…

Medium
1124

Longest Well-Performing Interval

The Longest Well-Performing Interval problem challenges you to find the longest subarray where tiring days exceed non-ti…

Medium
1130

Minimum Cost Tree From Leaf Values

Compute the minimum sum of non-leaf nodes in a binary tree formed from array leaves using dynamic programming efficientl…

Medium

swap_vertScroll inside the bank to auto-load more

Related Patterns

Monotonic Stack LeetCode Problems: 54 Solutions