Skip to content

Commit dbaafe1

Browse files
committedSep 18, 2018
add solution 001 [Python3]
1 parent 203c087 commit dbaafe1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 

‎solution/001.Two Sum/Solution.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution:
2+
def twoSum(self, nums, target):
3+
"""
4+
:type nums: List[int]
5+
:type target: int
6+
:rtype: List[int]
7+
"""
8+
for i in nums:
9+
tmp=nums.copy()
10+
tmp.remove(i)
11+
if target-i in tmp:
12+
return [nums.index(i),nums.index(target-i)]
13+
return [None,None]
14+

0 commit comments

Comments
 (0)
Please sign in to comment.