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 4925b5d commit d154feeCopy full SHA for d154fee
001_Two_Sum.py
@@ -1,17 +1,6 @@
1
class Solution:
2
def twoSum(self, nums: List[int], target: int) -> List[int]:
3
- # nums_index = list(enumerate(nums))
4
- # nums_index.sort()
5
- # print(nums)
6
for i in range(len(nums)):
7
complement = target-nums[i]
8
if complement in nums and nums.index(complement) != i:
9
return [i,nums.index(complement)]
10
- # for i in range(len(nums)-1):
11
- # j=i+1
12
- # while j < len(nums):
13
- # if nums[i]+nums[j]==target:
14
- # return [i, j]
15
- # j += 1
16
- # i += 1
17
- # return result
0 commit comments