This idea is to use alternative binary search rather than simply search the target - number[i] each time.

Although the worst case will also result in O(n) time complexity, but the overall performance is much better if the input is very sparse.

```
var twoSum = function(numbers, target) {
var i=0, j=numbers.length-1;
var sum;
while (i<j){
//move j using binary search to find largest nums[j] that nums[i] + nums[j] <= target
var tmpi = i+1, tmpj = j;
var first = numbers[i];
while (tmpi <= tmpj){
var m = Math.floor((tmpi+tmpj)/2);
if (numbers[m] + first === target){
return [i+1, m+1];
}
else if (numbers[m] + first > target){
tmpj = m-1;
}
else {
tmpi = m+1;
}
}
j = tmpj;
//move i using binary search to find smallest nums[i] that nums[i] + nums[j] >= target
var last = numbers[j];
tmpi = i+1, tmpj = j-1;
while (tmpi <= tmpj){
var m = Math.floor((tmpi+tmpj)/2);
if (numbers[m] + last === target){
return [m+1, j+1];
}
else if (numbers[m] + last > target){
tmpj = m-1;
}
else {
tmpi = m+1;
}
}
i = tmpi;
}
};
```