Skip to content

Commit f19005a

Browse files
authored
Create singleUniqueNumber.py
1 parent 5e20093 commit f19005a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) Dec 22, 2014 CareerMonk Publications and others.
2+
# E-Mail : [email protected]
3+
# Creation Date : 2014-01-10 06:15:46
4+
# Last modification : 2008-10-31
5+
# by : Narasimha Karumanchi
6+
# Book Title : Data Structures And Algorithmic Thinking With Python
7+
# Warranty : This software is provided "as is" without any
8+
# warranty; without even the implied warranty of
9+
# merchantability or fitness for a particular purpose.
10+
11+
class Solution(object):
12+
def singleNumber(self, A):
13+
"""
14+
:type A: List[int]
15+
:rtype: int
16+
"""
17+
result = 0
18+
for n in A:
19+
result ^= n
20+
return result

0 commit comments

Comments
 (0)