Skip to content

Commit 9117b00

Browse files
committed
@add: leetcode problem 1
1 parent 3be4572 commit 9117b00

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

leetcode/Solution.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,11 @@ def twoSum(self, nums: List[int], target: int) -> List[int]:
77
sumOf=nums[j] + nums[i]
88
if (sumOf == target):
99
return j, i
10-
# Enumeration is faster than this
10+
# Enumeration is faster than this
11+
# def twoSum(self, nums, target):
12+
# a ={}
13+
# for i, num in enumerate(nums):
14+
# if target-num in a:
15+
# return [a[target - num], i]
16+
# else:
17+
# a[num] = i

0 commit comments

Comments
 (0)