Update 3. 数组中重复的数字.md

感觉第39行的 swap没有存在的意义,因为执行到此处说明 i == nums[i],那么同一个位置交换前和交换后是没有什么变化的(swap(nums,  n, n))
This commit is contained in:
liyongjun1 2021-05-20 11:40:03 +08:00 committed by GitHub
parent a8c5a57065
commit e1f6309dd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,6 @@ public int duplicate(int[] nums) {
} }
swap(nums, i, nums[i]); swap(nums, i, nums[i]);
} }
swap(nums, i, nums[i]);
} }
return -1; return -1;
} }