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.
heights = [2, 1, 5, 6, 2, 3]10heights = [2, 4]41 <= heights.length <= 10^50 <= heights[i] <= 10^4Expected time complexity: O(n)Run your code to see results
Use Cmd+Enter to run