Python3 代码
class Solution(object):
def findNumbersWithSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
l = []
r = []
for x in nums:
if target - x in l:
r.append(target - x)
r.append(x)
else:
l.append(x)
return r