Update 57.1 和为 S 的两个数字.md
bug fix
This commit is contained in:
parent
2c31eddf34
commit
b540dbfdd1
@ -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…
x
Reference in New Issue
Block a user