LeetCode刷题记199-Two Pointers(双指针)
287. 寻找重复数再做一遍!!!class Solution { public int findDuplicate(int[] nums) { int slow = 0, fast = 0; do { slow = nums[slow]; fast = nums[nums[fast]]; } while (slow != fast); slow = 0; while
原创
2021-03-12 13:10:04 ·
102 阅读 ·
0 评论