We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54955eb commit 1d99935Copy full SHA for 1d99935
.project
Python/single-number.py
@@ -0,0 +1,11 @@
1
+class Solution:
2
+def singleNumber(self, nums: List[int]) -> int:
3
+ d = dict()
4
+ for i in range(len(nums)) :
5
+ if nums[i] not in d :
6
+ d[nums[i]] = 1
7
+ else:
8
+ d[nums[i]] += 1
9
+ for key, value in d.items() :
10
+ if value == 1 :
11
+ return key
0 commit comments