Pattern
Monotonic Stack
A compact view of archive entries grouped by recurring technique.
13 entries
13 entries tagged as Monotonic Stack.
11.01.2026
hard85. Maximal Rectangle
Max all-1 rectangle in 2D matrix stack
10.11.2025
medium3542. Minimum Operations to Convert All Elements to Zero
Min ops to zeros by making min of subarrays 0 stack
29.03.2025
hard2818. Apply Operations to Maximize Score
Multiply k numbers with max prime factor count stack
27.12.2024
medium1014. Best Sightseeing Pair
Max (a[i] + a[j] + i - j), i > j
22.12.2024
hard2940. Find Building Where Alice and Bob Can Meet
Common indices t, h[t] > h[a], h[t] > h[b] for queries q[][a,b] stack
18.12.2024
easy1475. Final Prices With a Special Discount in a Shop
Subtract next smaller value stack
13.12.2024
medium2593. Find Score of an Array After Marking All Elements
Sum of minimums in order excluding siblings stack
27.10.2024
medium1277. Count Square Submatrices with All Ones
Count 1-filled squares in 2D matrix programming
10.10.2024
medium962. Maximum Width Ramp
Max j-i between a[i] <= a[j] in an array stack
12.05.2024
easy2373. Largest Local Values in a Matrix
Max pooling by 3x3 matrix
06.05.2024
medium2487. Remove Nodes From Linked List
Make a Linked List non-increasing list
31.01.2024
medium739. Daily Temperatures
Array of distances to the next largest.
30.09.2023
medium456. 132 Pattern
132 pattern in array