File tree Expand file tree Collapse file tree 1 file changed +26
-7
lines changed
docs/Leetcode_Solutions/Python Expand file tree Collapse file tree 1 file changed +26
-7
lines changed Original file line number Diff line number Diff line change 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
2443Python的位操作:
2544< https://wiki.python.org/moin/BitwiseOperators >
2645
27- 神奇的解法:
46+
2847
2948
3049``` python
You can’t perform that action at this time.
0 commit comments