```
class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
int a = 0, b = numbers.size()-1;
int sum = numbers[a] + numbers[b];
while(a<b && sum!=target){
if(sum<target) a++;
else b--;
sum = numbers[a]+numbers[b];
}
return vector<int>{a+1,b+1};
}
};
```