Skip to content

Commit 8a0668b

Browse files
committed
136
1 parent ec5c902 commit 8a0668b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

136-single-number.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {number}
4+
*/
5+
var singleNumber = function(nums) {
6+
let result = 0;
7+
8+
for (let num of nums) {
9+
result ^= num;
10+
}
11+
12+
return result;
13+
};

0 commit comments

Comments
 (0)