Skip to content

Commit af819a9

Browse files
authored
删除 0494 目标和 JavaScript版本代码中的排序操作
对原数组升序排序是没有必要的
1 parent 6f65bb7 commit af819a9

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

problems/0494.目标和.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ const findTargetSumWays = (nums, target) => {
371371
}
372372
373373
const halfSum = (target + sum) / 2;
374-
nums.sort((a, b) => a - b);
375374
376375
let dp = new Array(halfSum+1).fill(0);
377376
dp[0] = 1;

0 commit comments

Comments
 (0)