def twoSum(nums, target):
    dict = {}
    for i, num in enumerate(nums):
        if target - num in dict:
            return [dict[target - num], i]
        dict[num] = i
    return []


nums = [2, 7, 11, 15]
target = 9
print(twoSum(nums, target))

3f486ac4aceb675a7715085eb2968b7ce996f929
<mask token>

def twoSum(nums, target):
    dict = {}
    for i, num in enumerate(nums):
        if target - num in dict:
            return [dict[target - num], i]
        dict[num] = i
    return []


<mask token>

def twoSum(nums, target):
    dict = {}
    for i, num in enumerate(nums):
        if target - num in dict:
            return [dict[target - num], i]
        dict[num] = i
    return []


<mask token>
print(twoSum(nums, target))

def twoSum(nums, target):
    dict = {}
    for i, num in enumerate(nums):
        if target - num in dict:
            return [dict[target - num], i]
        dict[num] = i
    return []


nums = [2, 7, 11, 15]
target = 9
print(twoSum(nums, target))
