class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
vector<int> res;
int n = numbers.size();
for (int l = 0, r = n - 1; l < r; l ++ )
{
while (numbers[l] + numbers[r] > target) r -- ;
if (numbers[l] + numbers[r] == target)
{
res.push_back(l + 1), res.push_back(r + 1);
return res;
}
}
return res;
}
};