Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8c5e25b

Browse files
🐱(bit): 136. 只出现一次的数字
1. 复盘 2. 补充 golang 题解
1 parent 8910bad commit 8c5e25b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

‎docs/algorithm/bit/README.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ class Solution(object):
3939
- 相同为 0,不同为 1
4040
- 0 与任何数异或都等于该数本身
4141

42+
<!-- tabs:start -->
43+
44+
#### **Python**
45+
4246
```python
4347
class Solution:
4448
def singleNumber(self, nums):
@@ -52,6 +56,20 @@ class Solution:
5256
return a
5357
```
5458

59+
#### **Go**
60+
61+
```go
62+
func singleNumber(nums []int) int {
63+
ans := 0
64+
for _, n := range nums {
65+
ans ^= n
66+
}
67+
return ans
68+
}
69+
```
70+
71+
<!-- tabs:end -->
72+
5573

5674
## 190. 颠倒二进制位
5775

‎docs/data-structure/linked_list/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ class Solution:
772772
class Solution:
773773
def reverseList(self, head: ListNode) -> ListNode:
774774
if head is None or head.next is None:
775-
return head
775+
return head
776776

777777
# 取下一个节点
778778
node = self.reverseList(head.next)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /