
Monotone Stack单调栈
Peng_maple
这个作者很懒,什么都没留下…
展开
-
[LeetCode] 42. Trapping Rain Water
Trapping Rain WaterGiven 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 · 192 阅读 · 0 评论 -
[LeetCode] 84. Largest Rectangle in Histogram
Largest Rectangle in HistogramGiven 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 · 125 阅读 · 0 评论 -
[leetcode] 221. Maximal Square && 85. Maximal Rectangle
Maximal SquareGiven 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 01 0 1 1 11 1 1 1 11 0 0 1 0Output: 4解法...原创 2019-07-28 13:18:36 · 280 阅读 · 0 评论