标签:bsp return tor end size red auto ++ val
把top 100重新刷一遍
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int,int> um; for(int i=0;i<nums.size();++i) { int val=target-nums[i]; auto ite=um.find(val); if(ite!=um.end()) return vector<int>{i,ite->second}; um[nums[i]]=i; } return vector<int>{0,0}; } };
标签:bsp return tor end size red auto ++ val
原文地址:https://www.cnblogs.com/LiuQiujie/p/13232914.html