标签:ash map find tin highlight tar ret int sum
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { vector<int> v(2,0); unordered_map<int,int> hashtable; for(int i=nums.size();i--;hashtable[nums[i]]=i){ if(hashtable.find(target-nums[i])==hashtable.end()) continue; v[0]=i; v[1]=hashtable[target-nums[i]]; return v; } return v; } };
标签:ash map find tin highlight tar ret int sum
原文地址:https://www.cnblogs.com/lettleshel/p/9016720.html