Skip to content

Commit 166af3d

Browse files
committed
refactor: remove duplicate check
1 parent ba3c3cb commit 166af3d

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

missing-number/tolluset.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ function missingNumber(nums: number[]): number {
88
const sum = (n * (n + 1)) / 2;
99
const actualSum = nums.reduce((acc, curr) => acc + curr, 0);
1010

11-
if (sum === actualSum) {
12-
return 0;
13-
}
14-
1511
return sum - actualSum;
1612
}
1713

0 commit comments

Comments
 (0)