From af819a97267fdf154dea9367425efddfce793757 Mon Sep 17 00:00:00 2001 From: Luo <82520819+Jerry-306@users.noreply.github.com> Date: Mon, 4 Oct 2021 09:21:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=200494=20=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E5=92=8C=20JavaScript=E7=89=88=E6=9C=AC=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=8E=92=E5=BA=8F=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对原数组升序排序是没有必要的 --- problems/0494.目标和.md | 1 - 1 file changed, 1 deletion(-) diff --git a/problems/0494.目标和.md b/problems/0494.目标和.md index 210ac749..00771c22 100644 --- a/problems/0494.目标和.md +++ b/problems/0494.目标和.md @@ -371,7 +371,6 @@ const findTargetSumWays = (nums, target) => { } const halfSum = (target + sum) / 2; - nums.sort((a, b) => a - b); let dp = new Array(halfSum+1).fill(0); dp[0] = 1;