#include "s0001_two_sum.hpp" vector S0001::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 {}; }