1
2
3
4
5
6
7
8
9
10
|
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
for i in range(len(nums)):
for j in range(i+1,len(nums)):
if target== nums[i]+nums[j]:
tmp=[]
tmp.append(i)
tmp.append(j)
return tmp
break
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
Leetcode 9. Palindrome Number (0) | 2021.07.12 |
---|---|
Leetcode 7. Reverse Integer (0) | 2021.07.12 |
Leetcode 1672. Richest Customer Wealth (0) | 2021.07.12 |
Leetcode 1108. Defanging an IP Address (0) | 2021.07.12 |
Leetcode 1480. Running Sum of 1d Array (0) | 2021.07.12 |
댓글