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 315bcb6 commit 31ad063Copy full SHA for 31ad063
two-sum/mandel-17.py
@@ -0,0 +1,9 @@
1
+from typing import List
2
+
3
+class Solution:
4
+ def twoSum(self, nums: List[int], target: int) -> List[int]:
5
+ for i, v in enumerate(nums):
6
+ second_value = target - v
7
8
+ if second_value in nums[i+1:]:
9
+ return [i, nums[i+1:].index(second_value) + i+1]
0 commit comments