class Solution { public: /** * * @param numbers int整型vector * @param target int整型 * @return int整型vector */ vector<int> twoSum(vector<int>& numbers, int target) { unordered_map<int, int> m; for(int i=0; i<numbers.size(); i++){ if(m.count(target-numbers[i])){ return {m[target-numbers[i]]+1, i+1}; } else{ m[numbers[i]] = i; } } return {}; // write code here } };