class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: seen = dict(); for i in range(0, len(nums)): x = nums[i] if target - x in seen: return [i, seen[target - x]] seen[x] = i