class Solution {
public:
vector<int> findNumbersWithSum(vector<int>& nums, int target) {
unordered_set<int> hashtable;
for(auto i:nums)
{
if(hashtable.count(target-i)) return vector<int>{i,target-i};
hashtable.insert(i);
}
}
};
标签:findNumbersWithSum,两个,target,nums,vector,hashtable,数字
From: https://www.cnblogs.com/tangxibomb/p/17387833.html