Some Coding Challenges: Maximal Area within a Bar plot.

applied.math.coding
3 min readMar 16, 2024

Assume you’re given a list of bars with an equal width of 1 which are laid out in a row and having the following heights: [4, 2, 8, 6, 5, 3]

What is the rectangle with the maximum area that is enclosed by these bars?

If you draw the above example you will quickly figure out that the bars with the heights [8, 6, 5] do enclose a rectangle with a…

--

--

applied.math.coding

I am a Software Developer - Java, Rust, SQL, TypeScript - with strong interest doing research in pure and applied Mathematics.