https://leetcode-cn.com/problems/two-sum/submissions/

    1. class Solution(object):
    2. def twoSum(self, nums, target):
    3. """
    4. :type nums: List[int]
    5. :type target: int
    6. :rtype: List[int]
    7. """
    8. hashmap = dict()
    9. for i, num in enumerate(nums):
    10. if(target-num in hashmap):
    11. return [hashmap[target-num], i]
    12. hashmap[num] = i