Finding, for every element, the first larger value to its right takes O(n²) if you scan from each element. A monotonic stack keeps only useful candidates and solves it in one O(n) pass. Reach for it in problems about the next or previous greater or smaller value, like stock span or daily temperatures. If you only need the single largest value to the right, a running maximum from the right is simpler.