Problem 84 · Hard

Largest Rectangle in Histogram

Find the largest rectangle that fits under a row of bars. The visual keeps a stack of increasing heights and pops bars to measure the width each one can extend.

Open the interactive visualisation