![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
每天一篇LeetCode
kejie1235
这个作者很懒,什么都没留下…
展开
-
42. Trapping Rain Water
https://leetcode.com/problems/trapping-rain-water/ 1. 首先我们遍历数组,找到数组中的最高点 2. 然后我们分两次遍历,从左到最高点,从右到最高点 3. cur 代表左边最高点,如果右边比它小,那么可以剩水。如果右边比它大,那么更新cur的值。 4. 如3所示,不过是从右边开始遍历。 ~~~~~~ 感谢大神能够提供如此简单易懂的解法原创 2016-08-08 09:50:16 · 270 阅读 · 0 评论 -
153. Find Minimum in Rotated Sorted Array QuestionEditorial Solution
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. You may assume no duplicate exists in原创 2016-08-09 14:33:26 · 272 阅读 · 0 评论