classSolution(object):deftwoSum(self, nums, target):"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
hashtable =dict()for i, num inenumerate(nums):if target - num in hashtable:return[hashtable[target - num], i]
hashtable[nums[i]]= i
return[]