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 bc4865c commit 6dc68e4Copy full SHA for 6dc68e4
two-sum/deepInTheWoodz.py
@@ -0,0 +1,10 @@
1
+class Solution:
2
+ def twoSum(self, nums: List[int], target: int) -> List[int]:
3
+ passed = dict()
4
+
5
+ for i, num in enumerate(nums):
6
+ other = target - num
7
+ if other in passed:
8
+ return [passed[other], i]
9
+ passed[num] = i
10
0 commit comments