Skip to main content
Matrix Engine

Maximal Rectangle Visualizer

See how each row of a binary matrix is transformed into a histogram height profile, then watch the stack-based largest-rectangle algorithm find the maximum all-ones sub-rectangle.

Binary Matrix

Cells highlight as rows are scanned.

Height Profile

Row → histogram reduction animated.

Max Rectangle

Optimal region revealed in real-time.

Interactive Visualizer

Click the cells below to toggle between 0 and 1, then calculate to see the maximal rectangle.