[leetcode 337]打败了100%的解法
题目概述
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 house has one and only one parent house. After a tour, the smart thief realized that "all houses in this place forms a binary tree". It will automatically contact the police if two directly-linked houses were broken into on the same night.
Determine the maximum amount of money the thief can rob tonight without alerting the police.
1 |
|
最快的解法
以下代码打败了100%的其它python3解法。 带记忆体的递归,也就是动态规划。
1 |
|
截图留念
1 |
|
[leetcode 337]打败了100%的解法
https://threelambda.com/2018/02/24/2018-2-24-robber-3/