snippet.python
class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        for idx, num in enumerate(nums):
            if target - num in nums:
                return idx, nums.index(target-num)

관련 문서