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.
Asked at 11 companies
AdobeAmazonBloomberg
Hints
1.Think about what data structure fits Largest Rectangle In Histogram
2.Consider the brute force complexity and how to optimize