The Perfect Pair
Previous Smaller Element (PSE) and Next Smaller Element (NSE) are frequently used together. By knowing the boundary on the left (PSE) and the right (NSE), you can easily calculate the span or area over which an element is the absolute minimum.