
LeetCode
文章平均质量分 76
DowntownGuy
这个作者很懒,什么都没留下…
展开
-
LeetCode-Add and Search Word - Data structure design
题目链接: https://leetcode.com/problems/add-and-search-word-data-structure-design/题目非常直白,并没有什么拐弯抹角的地方,本身就是设计一个字典查询功能,可以实现简单的插入和搜索功能。开始时,本不想设计太复杂的算法,心想用C++中的set集合或者map集合就可以。通过集合存储,查询时如果word中不包含.,那么直接查找返原创 2015-11-15 12:47:29 · 501 阅读 · 0 评论 -
LeetCode --- House Robber & House Robber II
House Roober让我们分三种情况考虑: - 拿[1]号房子,那么[2]和[N]号不能再拿,另外[3...N-1]退化为了直线型 - 拿[N]号房子,那么[1]和[N-1]号不能再拿,另外[2...N-2]退化为了直线型 - [1]和[N]号房子都不拿,那么[2...N-1]退化为了直线型原创 2015-12-16 17:13:50 · 520 阅读 · 0 评论