单调栈
少女情怀总是诗mmm
人生目标——成为一个富有的老姑娘
展开
-
Bad Hair Day (单调栈)
单调栈就是当把一个元素加进去之前,把比他值小的元素都弹出来 Some of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of othe...原创 2019-04-04 21:01:05 · 215 阅读 · 0 评论 -
【LeetCode】84. Largest Rectangle in Histogram(单调栈)
A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows ...原创 2019-04-10 21:02:20 · 153 阅读 · 0 评论