We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8604eda commit 14fe212Copy full SHA for 14fe212
two-sum/daiyongg-kim.py
@@ -0,0 +1,10 @@
1
+class Solution:
2
+ def twoSum(self, nums: List[int], target: int) -> List[int]:
3
+ hash_map = {}
4
+ for i, num in enumerate(nums):
5
+ current = target - num
6
+ if current in hash_map:
7
+ return [hash_map[current], i]
8
+ hash_map[num] = i
9
+ return []
10
+
0 commit comments