
LeetCode
weapl
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
85. Maximal Rectangle
题目: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. For example, given the following matrix: 1 0 1 0 0 1 0 1 1 1 1 1 1 1原创 2017-10-15 15:44:23 · 165 阅读 · 0 评论 -
leetcode 45. Jump Game II
思路是从55. Jump Game的贪心算法而来。45题的意思是求最小几步能够到达终点。此时我们需要三个变量。cur,last,step.下面从起始点开始推导并且解释三个变量。cur表示最大能到达的下标。last表示之前一次能到达的下标。step表示总共要几步。初始时cur,step,last皆为0。首先,起始点为i=0,最终可达点为cur=0+nums[0];i++;i=1时到cur,last=原创 2018-01-17 22:39:12 · 153 阅读 · 0 评论