Largest Rectangle in Histogram

Try to solve the Largest Rectangle in Histogram problem.


Given an array of integers, heights, that represents the heights of bars in a histogram, find the area of the largest rectangle in the histogram, where the rectangle has a constant width of 11 unit for each bar.


  • 11 \leq heights.length 105\leq 10^5
  • 00 \leq heights[i] 104\leq 10^4


Level up your interview prep. Join Educative to access 80+ hands-on prep courses.