```
func twoSum(_ numbers: [Int], _ target: Int) -> [Int] {
var begin = 0
var end = numbers.count - 1
while (begin < end) {
let sum = numbers[begin] + numbers[end]
if (sum == target) {
break
} else if (sum < target) {
begin += 1
} else {
end -= 1
}
}
return [begin + 1, end + 1]
}
}
```