代码随想录day60|84. 柱状图中最大的矩形

​​​​​​84. 柱状图中最大的矩形

class Solution:
    def largestRectangleArea(self, heights: List[int]) -> int:
        # st = [0]
        # result = 0
        # for i in range(1,len(heights)):
        #     if heights[i] >= heights[st[-1]]:
        #         st.append(i)
        #     else:
        #         while st and heights[i]= heights[st[-1]]:
                st.append(i)
            else:
                while st and heights[i]

你可能感兴趣的:(python,开发语言)