标签:
题目如下:
Python代码:
def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ temp = [] result = [] for i in range(len(nums)): if temp.count(target-nums[i])!=0: result.append(nums.index(target-nums[i])) result.append(i) if temp.count(nums[i])==0: temp.append(nums[i]) return result
标签:
原文地址:http://www.cnblogs.com/CQUTWH/p/5934600.html