#include "s0001_two_sum.hpp" using namespace std; vector Solution::twoSum(vector& nums, int target) { unordered_map hashtable; for (int i = 0; i < nums.size(); ++i) { auto it = hashtable.find(target - nums[i]); if (it != hashtable.end()) { return {it->second, i}; } hashtable[nums[i]] = i; } return {}; }