classSolution { public: vector<int> twoSum(vector<int>& numbers, int target){ for (int i = 0; i < numbers.size(); i ++) { int l = i + 1, r = numbers.size() - 1; while (l < r) { int mid = l + r + 1 >> 1; if (numbers[mid] <= target - numbers[i]) l = mid; else r = mid - 1; } if (target - numbers[i] == numbers[l]) return {i + 1, l + 1}; } return {-1, -1}; } };