LC 84
Largest Rectangle in Histogram
Hard · LC 1–100
Candidate solution routes
Primary
FreeMonotonic Stack for Nearest Greater/Smaller
Invariant: Stack indexes increase, their values are monotone in the chosen direction, and every stored index has not yet encountered a right-side item that resolves it.
candidate confidence: 0.740 · metadata_only
How to use this page
Read the statement and constraints first, then validate recognition signals, invariant, and complexity. Candidate score is not correctness evidence.