Files
PS/leetcode/1.py
Gyubin Han dede0dca01 leetcode
2025-02-19 14:09:55 +09:00

9 lines
282 B
Python

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)