From 65c44b50935e4f524f54304ae72597461bea3f5e Mon Sep 17 00:00:00 2001 From: zhu956645239 <38211259+zhu956645239@users.noreply.github.com> Date: Sat, 20 Feb 2021 13:48:20 +0800 Subject: [PATCH] =?UTF-8?q?Update=2057.1=20=E5=92=8C=E4=B8=BA=20S=20?= =?UTF-8?q?=E7=9A=84=E4=B8=A4=E4=B8=AA=E6=95=B0=E5=AD=97.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit L23: int cur = nums[i] + array[j]; This should be: L23: int cur = nums[i] + nums[j]; --- notes/57.1 和为 S 的两个数字.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/57.1 和为 S 的两个数字.md b/notes/57.1 和为 S 的两个数字.md index 8d15f13d..2f82aac4 100644 --- a/notes/57.1 和为 S 的两个数字.md +++ b/notes/57.1 和为 S 的两个数字.md @@ -20,7 +20,7 @@ public ArrayList 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)