def twoSum(nums,target):
dict = {}
for index in xrange(0,len(nums)):
num = nums[index]
if num in dict:
return [dict[num],index]
else:
dict[target-num]=index
print('we cannot find it')
leetcode--twosum
最新推荐文章于 2024-08-21 10:11:50 发布