Skip to content

Commit 1d99935

Browse files
python code added
1 parent 54955eb commit 1d99935

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.project

-11
This file was deleted.

Python/single-number.py

+11
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)