From 4643cdcc9fd3bba82c62d5b0f68481bc90265895 Mon Sep 17 00:00:00 2001 From: aaaaaabiao <736813089@qq.com> Date: Fri, 25 Jan 2019 11:53:01 +0800 Subject: [PATCH] =?UTF-8?q?Update=20Leetcode=20=E9=A2=98=E8=A7=A3.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/notes/Leetcode 题解.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/notes/Leetcode 题解.md b/docs/notes/Leetcode 题解.md index 9310948f..25e0b079 100644 --- a/docs/notes/Leetcode 题解.md +++ b/docs/notes/Leetcode 题解.md @@ -3050,7 +3050,6 @@ public boolean canPartition(int[] nums) { int W = sum / 2; boolean[] dp = new boolean[W + 1]; dp[0] = true; - Arrays.sort(nums); for (int num : nums) { // 0-1 背包一个物品只能用一次 for (int i = W; i >= num; i--) { // 从后往前,先计算 dp[i] 再计算 dp[i-num] dp[i] = dp[i] || dp[i - num];