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]){ ...
Markdown supported · ⌘↵ to post
No responses yet.