Update 57.1 和为 S 的两个数字.md
L23: int cur = nums[i] + array[j]; This should be: L23: int cur = nums[i] + nums[j];
This commit is contained in:
parent
d72820b1d0
commit
65c44b5093
|
@ -20,7 +20,7 @@
|
|||
public ArrayList<Integer> FindNumbersWithSum(int[] nums, int target) {
|
||||
int i = 0, j = nums.length - 1;
|
||||
while (i < j) {
|
||||
int cur = nums[i] + array[j];
|
||||
int cur = nums[i] + nums[j];
|
||||
if (cur == target)
|
||||
return new ArrayList<>(Arrays.asList(nums[i], nums[j]));
|
||||
if (cur < target)
|
||||
|
|
Loading…
Reference in New Issue
Block a user