From 4f652fd8d929702617f511192b7b212f84d38f19 Mon Sep 17 00:00:00 2001 From: quyan Date: Mon, 29 Apr 2019 11:06:59 +0800 Subject: [PATCH] =?UTF-8?q?Update=20Leetcode=20=E9=A2=98=E8=A7=A3=20-=20?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=A7=84=E5=88=92.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码缩进 --- docs/notes/Leetcode 题解 - 动态规划.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/notes/Leetcode 题解 - 动态规划.md b/docs/notes/Leetcode 题解 - 动态规划.md index 52269508..8ae2cec6 100644 --- a/docs/notes/Leetcode 题解 - 动态规划.md +++ b/docs/notes/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]);