84. Largest Rectangle in Histogram
class Solution {
public int largestRectangleArea(int[] heights) {
Stack<Integer> st = new Stack<>();
int res = 0;
for(int i=0; i<heights.length; i++){
while(!st.isEmpty() && heights[st.peek()] >= heights[i]){
...
searchinsert.hashnode.dev1 min read