class Solution:
def twoSum(self, nums, target):
mp = {}
for index, num in enumerate(nums):
another_num = target - num
if another_num in mp:
return [mp[another_num], index]
mp[num] = index
近期评论