leetcode
This commit is contained in:
8
leetcode/1.py
Normal file
8
leetcode/1.py
Normal file
@@ -0,0 +1,8 @@
|
||||
class Solution:
|
||||
def twoSum(self, nums: List[int], target: int) -> List[int]:
|
||||
answer=()
|
||||
for i in range(len(nums)):
|
||||
for j in range(i+1,len(nums)):
|
||||
if nums[i]+nums[j]==target:
|
||||
answer=(i,j)
|
||||
return list(answer)
|
||||
Reference in New Issue
Block a user