Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
leetcode: finished #260
Browse files Browse the repository at this point in the history
  • Loading branch information
xqm32 committed Aug 30, 2023
1 parent 28c3074 commit 8ff5b84
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions content/leetcode/2023/8.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,37 @@ title: "2023.8"
draft: false
---

# 2023.8.30

```python
#
# @lc app=leetcode.cn id=260 lang=python3
#
# [260] 只出现一次的数字 III
#

# @lc code=start
from typing import List


class Solution:
def singleNumber(self, nums: List[int]) -> List[int]:
xor = 0
for num in nums:
xor ^= num
mask = 1
while xor & mask == 0:
mask <<= 1
a, b = 0, 0
for num in nums:
if num & mask:
a ^= num
else:
b ^= num
return [a, b]
# @lc code=end
```

# 2023.8.29

```python
Expand Down

0 comments on commit 8ff5b84

Please sign in to comment.