Largest Rectangle in Histogram · Compound Engineer

Largest Rectangle in Histogram

Find the biggest rectangle in a bar chart. Work out the nearest shorter bar on each side of every bar, then find them all in one pass with a stack.

DSAFreeHardStep-through playerBy Aayush OstwalSolve on LeetCode ↗
Spotted a mistake in this lesson?Report an issue →