https://leetcode-cn.com/problems/two-sum/
def twoSum(nums, target):
""" 两数之和 """
dict1 = {}
for i in range(len(nums)):
temp = target - nums[i]
if dict1.get(temp) is not None:
return [dict1[temp], i]
else:
dict1[nums[i]] = i