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:
zhu956645239 2021-02-20 13:48:20 +08:00 committed by GitHub
parent d72820b1d0
commit 65c44b5093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)