#coding=utf-8
# 解题思路:查找表 适合只有唯一解的情况 20190302 找工作期间
class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
dic = {}
for i, num in enumerate(nums):
if num in dic:
return [dic[num], i]
else: dic[target - num] = i