Skip to content

Commit c8dc52e

Browse files
authored
Update 136._single_number.md
1 parent 21942c3 commit c8dc52e

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

docs/Leetcode_Solutions/Python/136._single_number.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
1-
### 136. Single Number
1+
# 136. Single Number
22

3+
**<font color=red>难度: Easy</font>**
34

5+
## 刷题内容
46

5-
题目:
6-
<https://leetcode.com/problems/single-number/>
7+
> 原题连接
78
9+
* https://leetcode.com/problems/single-number/description/
810

9-
难度:
11+
> 内容描述
1012
11-
Easy
13+
```
14+
Given a non-empty array of integers, every element appears twice except for one. Find that single one.
15+
16+
Note:
17+
18+
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
19+
20+
Example 1:
1221
22+
Input: [2,2,1]
23+
Output: 1
24+
Example 2:
1325
14-
思路:
26+
Input: [4,1,2,1,2]
27+
Output: 4
28+
```
29+
30+
## 解题方案
31+
32+
> 思路 1
33+
******- 时间复杂度: O(N)******- 空间复杂度: O(N)******
1534

1635
位运算,终于要take it了
1736

@@ -24,7 +43,7 @@ Easy
2443
Python的位操作:
2544
<https://wiki.python.org/moin/BitwiseOperators>
2645

27-
神奇的解法:
46+
2847

2948

3049
```python

0 commit comments

Comments
 (0)