Groups
Category
A stack is a Last-In, First-Out (LIFO) data structure where push, pop, and top operations run in O(1) time.
A monotonic stack is a stack that keeps its elements in increasing or decreasing order to answer range queries in linear time.