使用字典,字典key为数组中的元素,value为该元素在字典中的索引。 在遍历数组的时候,去字典中看是否有一个key,它的值正好是target - nums[i], 如果存在,则正好是num[i] + key = target,此时就找到了两个和是target的数,返回它们的索引。
(int[] nums, in int target)
source not stored for this graph (policy: none)
nothing calls this directly
no test coverage detected