From e1f6309dd3605ba194a4afa1977d497fb8edc9ca Mon Sep 17 00:00:00 2001 From: liyongjun1 Date: Thu, 20 May 2021 11:40:03 +0800 Subject: [PATCH] =?UTF-8?q?Update=203.=20=E6=95=B0=E7=BB=84=E4=B8=AD?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E7=9A=84=E6=95=B0=E5=AD=97.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 感觉第39行的 swap没有存在的意义,因为执行到此处说明 i == nums[i],那么同一个位置交换前和交换后是没有什么变化的(swap(nums, n, n)) --- notes/3. 数组中重复的数字.md | 1 - 1 file changed, 1 deletion(-) diff --git a/notes/3. 数组中重复的数字.md b/notes/3. 数组中重复的数字.md index babab09d..4469fccf 100644 --- a/notes/3. 数组中重复的数字.md +++ b/notes/3. 数组中重复的数字.md @@ -36,7 +36,6 @@ public int duplicate(int[] nums) { } swap(nums, i, nums[i]); } - swap(nums, i, nums[i]); } return -1; }