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 443cf68 commit ea3cb48Copy full SHA for ea3cb48
two-sum/JisuuungKim.py
@@ -0,0 +1,10 @@
1
+class Solution:
2
+ def twoSum(self, nums: List[int], target: int) -> List[int]:
3
+ d = {}
4
+ for i in range(len(nums)):
5
+ cur = nums[i]
6
+ x = target - cur
7
+ if x in d:
8
+ return [i, d[x]]
9
+ else:
10
+ d[cur] = i
0 commit comments