努橙刷题编

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2017年6月2日

摘要: https://leetcode.com/problems/trapping-rain-water/ 思路一:参考 84. Largest Rectangle in Histogram,用 stack 做辅助 思路二:dynamic programming 阅读全文
posted @ 2017-06-02 15:39 努橙 阅读(110) 评论(0) 推荐(0) 编辑

摘要: https://leetcode.com/problems/maximal-square/ dp[i][j] - 以 matrix[i][j] 为右下角的正方形的最大边长 阅读全文
posted @ 2017-06-02 00:02 努橙 阅读(150) 评论(0) 推荐(0) 编辑

2017年6月1日

摘要: https://leetcode.com/problems/maximal-rectangle/ 思路一:这道题和前面那道 84. Largest Rectangle in Histogram 类似,遍历二维数组,生成一个 heights 数组,然后用 Largest Rectangle in Hi 阅读全文
posted @ 2017-06-01 00:44 努橙 阅读(150) 评论(0) 推荐(0) 编辑

2017年5月31日

摘要: https://leetcode.com/problems/largest-rectangle-in-histogram/ 阅读全文
posted @ 2017-05-31 15:19 努橙 阅读(126) 评论(0) 推荐(0) 编辑

2017年5月29日

摘要: https://leetcode.com/problems/binary-tree-right-side-view/ 阅读全文
posted @ 2017-05-29 14:57 努橙 阅读(153) 评论(0) 推荐(0) 编辑

摘要: https://leetcode.com/problems/find-bottom-left-tree-value/ 用 BFS,层次遍历 阅读全文
posted @ 2017-05-29 14:38 努橙 阅读(159) 评论(0) 推荐(0) 编辑

摘要: https://leetcode.com/problems/find-largest-value-in-each-tree-row/ BFS,和树的 level order traversal 差不多 阅读全文
posted @ 2017-05-29 13:28 努橙 阅读(143) 评论(0) 推荐(0) 编辑

摘要: https://leetcode.com/problems/minesweeper/ 阅读全文
posted @ 2017-05-29 09:10 努橙 阅读(511) 评论(0) 推荐(0) 编辑

摘要: https://leetcode.com/problems/01-matrix/ 思路参考:http://www.cnblogs.com/grandyang/p/6602288.html 阅读全文
posted @ 2017-05-29 06:44 努橙 阅读(137) 评论(0) 推荐(0) 编辑

摘要: https://leetcode.com/problems/range-addition-ii 思路1: brute force - O(m * n * k), k = number of ops思路2: 从 ops 中找到被操作次数最多的 row 和 column,这可以通过遍历 ops 数组,分 阅读全文
posted @ 2017-05-29 04:49 努橙 阅读(197) 评论(0) 推荐(0) 编辑