Merge pull request #815 from Jerry-306/patch-29

删除 0494 目标和 JavaScript版本代码中的排序操作
This commit is contained in:
程序员Carl
2021-10-06 16:18:54 +08:00
committed by GitHub

View File

@ -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;