Skip to content

Commit 7837258

Browse files
committed
Time: 51 ms (92.33%) | Memory: 17.8 MB (27.33%) - LeetSync
1 parent 0b1f9b7 commit 7837258

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

1-two-sum/two-sum.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ class Solution:
33
def twoSum(self, nums: List[int], target: int) -> List[int]:
44
map = defaultdict(int)
55

6-
for index , num in enumerate(nums):
7-
y = target - num
8-
print(num, index)
6+
for index, num in enumerate(nums):
7+
y = target - num
98
if y in map:
10-
return [map[y], index]
11-
map[num] = index
12-
13-
return []
9+
return [map[y],index]
10+
map[num] = index
11+
return [-1,-1]
1412

0 commit comments

Comments
 (0)