Skip to content

Commit 4e2a88e

Browse files
add javascript solution for 268
1 parent 6f334e0 commit 4e2a88e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const missingNumber = function(nums){
2+
return (1 + nums.length)*nums.length/2 - nums.reduce((prev,cur)=>prev+=cur, 0);
3+
}

0 commit comments

Comments
 (0)