Monotone Stack单调栈
Peng_maple
这个作者很懒,什么都没留下…
展开
-
[LeetCode] 42. Trapping Rain Water
Trapping Rain Water Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. Example: Input: [0,1,0,2,1,...原创 2019-03-31 21:25:33 · 172 阅读 · 0 评论 -
[LeetCode] 84. Largest Rectangle in Histogram
Largest Rectangle in Histogram Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram. Example: I...原创 2019-07-23 16:34:35 · 104 阅读 · 0 评论 -
[leetcode] 221. Maximal Square && 85. Maximal Rectangle
Maximal Square Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area. Example: Input: 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Output: 4 解法...原创 2019-07-28 13:18:36 · 251 阅读 · 0 评论