Update 0001.两数之和.md

Fix Python solution comment
This commit is contained in:
Liu Yongliang
2023-07-08 07:25:59 +08:00
committed by GitHub
parent 5974c82aea
commit 873257dcd8

View File

@ -160,7 +160,7 @@ class Solution:
for index, value in enumerate(nums):
if target - value in records: # 遍历当前元素并在map中寻找是否有匹配的key
return [records[target- value], index]
records[value] = index # 遍历当前元素并在map中寻找是否有匹配的key
records[value] = index # 如果没找到匹配对就把访问过的元素和下标加入到map中
return []
```
(版本二)使用集合