标签:pytho for result leetcode dict nbsp target blog logs
def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ dict = {} result = [] for i in range(len(nums)): dict[nums[i]]= i print(dict) for i in range(len(nums)): if (dict.get(target-nums[i]) != None) & (dict[target-nums[i]] != i ): print(i) result.append(i) result.append(dict.get(target-nums[i])) break return result
标签:pytho for result leetcode dict nbsp target blog logs
原文地址:http://www.cnblogs.com/gforc/p/7467543.html