摘要:
原题链接:http://oj.leetcode.com/problems/subsets/题意描述:Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For example,IfS=[1,2,3], a solution is:[ [3], [1], [2], [1,2,3], [1,3],... 阅读全文
阅读排行榜
[LeetCode]House Robber
2015-04-06 17:31 by 庸男勿扰, 260 阅读, 收藏,
摘要:
原题链接:https://leetcode.com/problems/house-robber/题意描述:You are a professional robber planning to rob houses along a street. Each house has a certain amo... 阅读全文
[LeetCode]Linked List Cycle
2014-03-14 11:07 by 庸男勿扰, 258 阅读, 收藏,
摘要:
原题链接:http://oj.leetcode.com/problems/linked-list-cycle/题意描述:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?题解: 判断一个单链表中是否有环,这是一道典型的快慢指针的题,具体概念参见百度:http://baike.baidu.com/link?url=6vrn7yMJjWonSHrzGNLZA16JoJZxrLkFuRtJH3oP3PHCBakSKKM2UQH-5xt. 阅读全文
[LeetCode]Subsets II
2014-03-24 19:49 by 庸男勿扰, 242 阅读, 收藏,
摘要:
原题链接:http://oj.leetcode.com/problems/subsets-ii/题意描述:Given a collection of integers that might contain duplicates,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For example,IfS=[1,2,2], a solution is:[ [2]. 阅读全文
[LeetCode]Number of Islands
2015-04-08 19:59 by 庸男勿扰, 202 阅读, 收藏,
摘要:
原题链接:https://leetcode.com/problems/number-of-islands/题意描述:Given a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is... 阅读全文
浙公网安备 33010602011771号