class Solution { public: vector<int> findNumbersWithSum(vector<int>& nums, int target) { unordered_set<int> S; for (auto x : nums) if (S.count(target - x)) return {x, target - x}; else S.insert(x); } };