python3 代码
class Solution(object):
def findNumbersWithSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
d = dict()
for num in nums:
if num in d.keys():
return [target-num,num]
else:
d[target-num] = num