Here is the implementation:
function twoSum(numbers, target):
left = 0
right = numbers.length - 1
while left < right:
sum = numbers[left] + numbers[right]
if sum == target:
return [left + 1, right + 1]
else if sum < target:
left += 1
else:
right -= 1
return [-1, -1]
This runs in time and space (excluding input). Each element is visited at most once.