20211108-01 Two Sum
https://leetcode-cn.com/problems/two-sum/
python
# 题目给了边界限制,所以代码中没做判断
class Solution(object):
def twoSum(self, nums, target):
dic = {}
for idx, num in enumerate(nums):
if target - num in dic:
return [idx, dic[target - num]]
dic[num] = idx