###### leecode 167. Two Sum II - Input array is sorted

public int[] twoSum(int[] numbers, int target) {
int begin = 0;
int end = numbers.length - 1;
while (begin < end) {
// 1.相等就结束了
if (numbers[begin] + numbers[end] == target) {
break;
}
// 2.两数结果 < target
else if (numbers[begin] + numbers[end] < target) {
begin++;
}
// 2.两数结果 > target
else if (numbers[begin] + numbers[end] > target) {
end--;
}
}

int nums[] = { begin + 1, end + 1 };
return nums;
}

#### 167. Two Sum II - Input array is sorted [medium] (Python)

2016-08-31 19:33:40

#### leetcode 167: Two Sum II - Input array is sorted

2014-12-31 08:27:56

#### Leetcode-167. Two Sum II - Input array is sorted c语言

2016-09-01 20:42:00

#### LeetCode 167. Two Sum II - Input array is sorted 题解（C++）

2016-10-07 17:21:31

#### LeetCode oj 167. Two Sum II - Input array is sorted （双指针）

2016-10-05 19:01:33

#### LeetCode-Easy部分中标签为 Binary Search 167. Two Sum II - Input array is sorted

2017-04-08 22:20:20

#### LeetCode Two Sum II - Input array is sorted(Two pointer问题)

2016-08-19 13:09:26

#### Two Sum II - Input array is sorted问题及解法

2017-03-25 10:24:38

#### leetcode_167. Two Sum II - Input array is sorted 有序数组中找和为特定数的两个数的下标

2016-11-12 22:05:52

#### 【leetcode】Two Sum II - Input array is sorted(输入有序的数组，求两个数的和)

2017-04-21 10:49:24

## 不良信息举报

leecode 167. Two Sum II - Input array is sorted