1 class Solution: 2 def twoSum(self, nums: List[int], target: int) -> List[int]: 3 for i in range(len(nums)): 4 if (target - nums[i]) in nums and i != nums.index(target - nums[i]): 5 return [i, nums.index(target - nums[i])]
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3