Skip to content

Commit 8077c43

Browse files
committed
single_number
1 parent bfef5c3 commit 8077c43

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ Golang solution for leetcode. For each problem, there is a simple *_test.go to t
119119
#### [133. Clone Graph](https://github.com/hitzzc/go-leetcode/tree/master/clone_graph)
120120
#### [134. gas station](https://github.com/hitzzc/go-leetcode/tree/master/gas_station)
121121
#### [135. candy](https://github.com/hitzzc/go-leetcode/tree/master/candy)
122+
#### [136. single number](https://github.com/hitzzc/go-leetcode/tree/master/single_number)
122123

123124

124125

single_number/single_number.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package single_number
2+
3+
func singleNumber(nums []int) int {
4+
ret := 0
5+
for i := range nums {
6+
ret ^= nums[i]
7+
}
8+
return ret
9+
}

0 commit comments

Comments
 (0)