We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 651b4bd commit b94fa5cCopy full SHA for b94fa5c
Day137Question137/Solution.py
@@ -0,0 +1,11 @@
1
+from typing import List
2
+
3
+class Solution:
4
+ def singleNumber(self, nums: List[int]) -> int:
5
+ ones, twos = 0, 0
6
7
+ for num in nums:
8
+ ones = (ones ^ num) & ~twos
9
+ twos = (twos ^ num) & ~ones
10
11
+ return ones
0 commit comments