Skip to content

Commit 39379bd

Browse files
committed
feat: adds single_number exercise
1 parent 59616b1 commit 39379bd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

single_number.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from typing import List
2+
3+
4+
class Solution:
5+
def singleNumber(self, nums: List[int]) -> int:
6+
result = 0
7+
8+
for num in nums:
9+
result ^= num
10+
11+
return result

0 commit comments

Comments
 (0)