File tree 3 files changed +26
-1
lines changed
3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 86
86
| [ 121] [ 121-question ] | [ Best Time to Buy and Sell Stock] [ 121-tips ] | [ Easy] [ E ] | [ ✅] [ 121-java ] | [ ✅] [ 121-js ] | [ ✅] [ 121-kotlin ] |
87
87
| [ 122] [ 122-question ] | [ Best Time to Buy and Sell Stock II] [ 122-tips ] | [ Easy] [ E ] | [ ✅] [ 122-java ] | [ ✅] [ 122-js ] | [ ✅] [ 122-kotlin ] |
88
88
| [ 125] [ 125-question ] | [ Valid Palindrome] [ 125-tips ] | [ Easy] [ E ] | | [ ✅] [ 125-js ] | [ ✅] [ 125-kotlin ] |
89
- | [ 136] [ 136-question ] | [ Single Number] [ 136-tips ] | [ Easy] [ E ] | | | [ ✅] [ 136-kotlin ] |
89
+ | [ 136] [ 136-question ] | [ Single Number] [ 136-tips ] | [ Easy] [ E ] | | [ ✅ ] [ 136-js ] | [ ✅] [ 136-kotlin ] |
90
90
| [ 141] [ 141-question ] | [ Linked List Cycle] [ 141-tips ] | [ Easy] [ E ] | [ ✅] [ 141-java ] | | - |
91
91
| [ 155] [ 155-question ] | [ Min Stack] [ 155-tips ] | [ Easy] [ E ] | [ ✅] [ 155-java ] | | [ ✅] [ 155-kotlin ] |
92
92
| [ 160] [ 160-question ] | [ Intersection of Two Linked Lists] [ 160-tips ] | [ Easy] [ E ] | [ ✅] [ 160-java ] | | - |
@@ -466,6 +466,7 @@ commit信息模板: ``feat: add the solution of `Two Sum`(001) with Java``
466
466
[ 121-js ] : ./src/_121/Solution.js
467
467
[ 122-js ] : ./src/_122/Solution.js
468
468
[ 125-js ] : ./src/_125/Solution.js
469
+ [ 136-js ] : ./src/_136/Solution.js
469
470
[ 226-js ] : ./src/_226/Solution.js
470
471
[ 561-js ] : ./src/_561/Solution.js
471
472
[ 643-js ] : ./src/_643/Solution.js
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @param {number[] } nums
3
+ * @return {number }
4
+ */
5
+ var singleNumber = function ( nums ) {
6
+ var x = 0
7
+ for ( let i = 0 ; i < nums . length ; i ++ ) {
8
+ x = x ^ nums [ i ]
9
+ }
10
+ return x
11
+ } ;
Original file line number Diff line number Diff line change @@ -63,6 +63,19 @@ fun singleNumber(nums: IntArray): Int {
63
63
}
64
64
```
65
65
66
+ ``` JavaScript
67
+ /**
68
+ * @param {number[]} nums
69
+ * @return {number}
70
+ */
71
+ var singleNumber = function (nums ) {
72
+ var x = 0
73
+ for (let i = 0 ; i < nums .length ; i++ ) {
74
+ x = x^ nums[i]
75
+ }
76
+ return x
77
+ };
78
+ ```
66
79
## 结语
67
80
68
81
如果你同我们一样热爱数据结构、算法、LeetCode,可以关注我们 GitHub 上的 LeetCode 题解:[ LeetCode-Solution] [ ls ]
You can’t perform that action at this time.
0 commit comments