Skip to content

Commit 4782451

Browse files
committed
136
1 parent 52b61d3 commit 4782451

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

136/main.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {number}
4+
*/
5+
var singleNumber = function(nums) {
6+
return nums.reduce((res, elt) => res ^ elt)
7+
};
8+
9+
if (process.env.LZS) {
10+
console.log(singleNumber([1, 2, 3, 2, 3]))
11+
console.log(singleNumber([1, 2, 3, 2, 1, 3, 0]))
12+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
- [102 Binary Tree Level Order Traversal](./102)
8484
- [119 Pascal's Triangle II](./119)
8585
- [121 Best Time to Buy and Sell Stock](./121)
86+
- [136 Single Number](./136)
8687
- [144 Binary Tree Preorder Traversal](./144)
8788
- [145 Binary Tree Postorder Traversal](./145)
8889
- [152 Maximum Product Subarray](./152)

0 commit comments

Comments
 (0)