摘要:
https://leetcode.com/problems/trapping-rain-water/ 思路一:参考 84. Largest Rectangle in Histogram,用 stack 做辅助 思路二:dynamic programming 阅读全文
摘要:
https://leetcode.com/problems/maximal-square/ dp[i][j] - 以 matrix[i][j] 为右下角的正方形的最大边长 阅读全文
摘要:
https://leetcode.com/problems/maximal-rectangle/ 思路一:这道题和前面那道 84. Largest Rectangle in Histogram 类似,遍历二维数组,生成一个 heights 数组,然后用 Largest Rectangle in Hi 阅读全文
摘要:
https://leetcode.com/problems/largest-rectangle-in-histogram/ 阅读全文
摘要:
https://leetcode.com/problems/binary-tree-right-side-view/ 阅读全文
摘要:
https://leetcode.com/problems/find-bottom-left-tree-value/ 用 BFS,层次遍历 阅读全文
摘要:
https://leetcode.com/problems/find-largest-value-in-each-tree-row/ BFS,和树的 level order traversal 差不多 阅读全文
摘要:
https://leetcode.com/problems/minesweeper/ 阅读全文
摘要:
https://leetcode.com/problems/01-matrix/ 思路参考:http://www.cnblogs.com/grandyang/p/6602288.html 阅读全文
摘要:
https://leetcode.com/problems/range-addition-ii 思路1: brute force - O(m * n * k), k = number of ops思路2: 从 ops 中找到被操作次数最多的 row 和 column,这可以通过遍历 ops 数组,分 阅读全文