摘要: 原题链接 单调栈,首位各插入一个0,避免讨论栈为空的情况 class Solution { public: int largestRectangleArea(vector<int>& heights) { int ans=0; stack<int>st; //首位各自插入0,避免了讨论栈是否为空 h 阅读全文
posted @ 2021-04-24 11:52 Tsukinousag1 阅读(52) 评论(0) 推荐(0)