未验证 提交 36d127c9 编写于 作者: C CyC2018 提交者: GitHub

Merge pull request #690 from somone23412/patch-4

Update Leetcode 题解 - 动态规划.md : 代码缩进
......@@ -110,7 +110,7 @@ public int rob(int[] nums) {
[213. House Robber II (Medium)](https://leetcode.com/problems/house-robber-ii/description/)
```java
public int rob(int[] nums) {
public int rob(int[] nums) {
if (nums == null || nums.length == 0) {
return 0;
}
......@@ -121,7 +121,7 @@ public int rob(int[] nums) {
return Math.max(rob(nums, 0, n - 2), rob(nums, 1, n - 1));
}
private int rob(int[] nums, int first, int last) {
private int rob(int[] nums, int first, int last) {
int pre2 = 0, pre1 = 0;
for (int i = first; i <= last; i++) {
int cur = Math.max(pre1, pre2 + nums[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册