上一页 1 ··· 164 165 166 167 168 169 170 171 172 ··· 235 下一页
摘要: 原题目: http://www.cnblogs.com/grandyang/p/5297683.html 但是上面的解法写的不好。看下面的: https://discuss.leetcode.com/topic/31702/36-ms-c-solution 就是从每一个房子出发,用BFS,算出每个空 阅读全文
posted @ 2017-02-26 13:12 blcblc 阅读(226) 评论(0) 推荐(0)
摘要: 以前看过:http://www.cnblogs.com/charlesblc/p/5619932.html 复习一下。 阅读全文
posted @ 2017-02-26 12:51 blcblc 阅读(246) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/split-array-largest-sum/?tab=Description 开始用的是回溯法,很常规,但是TLE了。根据下面的解法,用的是结果集的反向判断。 https://discuss.leetcode.com/topic/613 阅读全文
posted @ 2017-02-26 12:36 blcblc 阅读(211) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/search-in-rotated-sorted-array/?tab=Description 很好的很经典的题目。今天复习了一下。之前的思路虽然有了,但是对于相等的数字的处理很复杂,容易出错。今天看到了一个很好的解法。 https://d 阅读全文
posted @ 2017-02-26 12:07 blcblc 阅读(671) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/russian-doll-envelopes/?tab=Description 包信封问题,可以转化成最长有序子序列问题,见下面的分析: https://discuss.leetcode.com/topic/47469/java-nlogn 阅读全文
posted @ 2017-02-26 01:17 blcblc 阅读(252) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/serialize-and-deserialize-binary-tree/?tab=Description 下面这个解法里面的C++部分很好: https://discuss.leetcode.com/topic/28041/recurs 阅读全文
posted @ 2017-02-26 00:42 blcblc 阅读(376) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/patching-array/?tab=Description 好题目啊,下面的解法绝顶聪明: https://discuss.leetcode.com/topic/35494/solution-explanation 阅读全文
posted @ 2017-02-26 00:38 blcblc 阅读(151) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/sliding-window-maximum/?tab=Description 下面的解法真的非常巧妙。用了deque,然后模拟队列,始终只保持比当前之前更大的,因为当前之前更小的,是没有机会成为max的。 https://discuss. 阅读全文
posted @ 2017-02-26 00:22 blcblc 阅读(158) 评论(0) 推荐(0)
摘要: 题目: https://leetcode.com/problems/distinct-subsequences/?tab=Description 一般没有明显思路的情况下,都要想想DP,用下Divide-and-Conque 下面的思路很好,很清晰 https://discuss.leetcode. 阅读全文
posted @ 2017-02-26 00:05 blcblc 阅读(329) 评论(0) 推荐(0)
摘要: http://blog.csdn.net/zqh_1991/article/details/52729203 阅读全文
posted @ 2017-02-25 23:51 blcblc 阅读(193) 评论(0) 推荐(0)
上一页 1 ··· 164 165 166 167 168 169 170 171 172 ··· 235 下一页