nums = [2, 7, 11, 15]
target = 9


def twoSum(nums, target):
    dicT = {}
    for i in range(len(nums)):
        if target - nums[i] not in dicT:
            dicT[nums[i]] = i
        else:
            return [dicT[target - nums[i]], i]


print(twoSum(nums, target))

a2b6764eda66b9abb95ae1326ac39a2aa943f1df
<mask token>

<mask token>


def twoSum(nums, target):
    dicT = {}
    for i in range(len(nums)):
        if target - nums[i] not in dicT:
            dicT[nums[i]] = i
        else:
            return [dicT[target - nums[i]], i]


<mask token>

<mask token>


def twoSum(nums, target):
    dicT = {}
    for i in range(len(nums)):
        if target - nums[i] not in dicT:
            dicT[nums[i]] = i
        else:
            return [dicT[target - nums[i]], i]


print(twoSum(nums, target))

nums = [2, 7, 11, 15]
target = 9


def twoSum(nums, target):
    dicT = {}
    for i in range(len(nums)):
        if target - nums[i] not in dicT:
            dicT[nums[i]] = i
        else:
            return [dicT[target - nums[i]], i]


print(twoSum(nums, target))
