LeetCode 84. Largest Rectangle in Histogram in Java

In this post we will solve LeetCode 84. Largest Rectangle in Histogram problem using the Java programming language and the VSCode IDE on a Windows computer.

Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, 
return the area of the largest rectangle in the histogram.

Constraints:

o 1 <= heights.length <= 10^5
o 0 <= heights[i] <= 10^4

Related Topics:
* Array
o Stack
* Monotonic Stack

We are given an array representing a histogram. The width of each bar holding a value is 1 unit. We are asked to return the area of the largest rectangle in the histogram. Continue reading “LeetCode 84. Largest Rectangle in Histogram in Java”