1 def twoSum(nums, target): 2 d = {} 3 for i, num in enumerate(nums): 4 if target - num in d: 5 return (d[target-num], i) 6 d[num] = i
posted on 2018-01-30 21:33 小马过_河 阅读(144) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 小马过_河 Powered by .NET 9.0 on Kubernetes