You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo ...
分类:
其他好文 时间:
2016-04-17 10:19:50
阅读次数:
135
一开始以为不直接连接的话就考虑隔层加钱,偶数层和奇数层分开算得两个结果,但是输入为[4,1,null,2,null,null,3]时最大值为4+3 = 7,4是第0层,3是3层。 因此要以节点为对象,而不是层。每个节点的情况分两种,抢和不抢,如果抢当前节点,那么左右节点不能抢;如果不抢,那么当前节点 ...
分类:
其他好文 时间:
2016-04-12 21:01:32
阅读次数:
339
Robberies Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Description The aspiring Roy the Robber has seen a lot of A ...
分类:
其他好文 时间:
2016-04-06 02:07:03
阅读次数:
237
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo ...
分类:
其他好文 时间:
2016-04-05 07:06:00
阅读次数:
146
1. Description The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the ...
分类:
其他好文 时间:
2016-04-03 15:59:26
阅读次数:
175
原题链接在这里:https://leetcode.com/problems/house-robber-iii/ 题目: The thief has found himself a new place for his thievery again. There is only one entrance ...
分类:
其他好文 时间:
2016-03-27 07:13:28
阅读次数:
133
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each hou
分类:
其他好文 时间:
2016-03-20 17:57:45
阅读次数:
142
Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so tha
分类:
其他好文 时间:
2016-03-18 17:28:26
阅读次数:
203
Total Accepted: 1341 Total
Submissions: 3744 Difficulty: Medium
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." B...
分类:
其他好文 时间:
2016-03-15 14:58:48
阅读次数:
349
题目的意思是,小偷找到了一个新的偷盗场所。这片区域只有一个入口,叫做“根”。除了根以外,每个屋子有且仅有一个父屋子。在踩点之后盗贼发现,所有的房间构造形成了一棵二叉树。如果两个直接相连的屋子在同时被盗窃,就会惊动警察。...
分类:
其他好文 时间:
2016-03-15 14:56:09
阅读次数:
305