diff --git "a/\351\253\230\351\242\221\351\235\242\350\257\225\347\263\273\345\210\227/\347\274\272\345\244\261\345\222\214\351\207\215\345\244\215\347\232\204\345\205\203\347\264\240.md" "b/\351\253\230\351\242\221\351\235\242\350\257\225\347\263\273\345\210\227/\347\274\272\345\244\261\345\222\214\351\207\215\345\244\215\347\232\204\345\205\203\347\264\240.md" index 9e0b5507e810f78e6234b6f5b09d6f9e865ebf87..eb21f4c8cb975e24e6875f7327c0d2f65c4b589c 100644 --- "a/\351\253\230\351\242\221\351\235\242\350\257\225\347\263\273\345\210\227/\347\274\272\345\244\261\345\222\214\351\207\215\345\244\215\347\232\204\345\205\203\347\264\240.md" +++ "b/\351\253\230\351\242\221\351\235\242\350\257\225\347\263\273\345\210\227/\347\274\272\345\244\261\345\222\214\351\207\215\345\244\215\347\232\204\345\205\203\347\264\240.md" @@ -148,7 +148,7 @@ class Solution { int n = nums.length; int dup = -1; for (int i = 0; i < n; i++) { - // 元素是从 1 开始的 + // 元素是从 1 开始的 int index = Math.abs(nums[i]) - 1; // nums[index] 小于 0 则说明重复访问 if (nums[index] < 0) @@ -160,7 +160,7 @@ class Solution { for (int i = 0; i < n; i++) // nums[i] 大于 0 则说明没有访问 if (nums[i] > 0) - // 将索引转换成元素 + // 将索引转换成元素 missing = i + 1; return new int[]{dup, missing}; }