We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30bc228 commit 9c85dbeCopy full SHA for 9c85dbe
Contents/01.Array/04.Array-Two-Pointers/01.Array-Two-Pointers.md
@@ -250,7 +250,7 @@ return 合适的值
250
1. 定义两个快慢指针 `slow`,`fast`。其中 `slow` 指向去除重复元素后的数组的末尾位置。`fast` 指向当前元素。
251
2. 令 `slow` 在后, `fast` 在前。令 `slow = 0`,`fast = 1`。
252
3. 比较 `slow` 位置上元素值和 `fast` 位置上元素值是否相等。
253
- - 如果不相等,则将 `slow` 后移一位,将 `fast` 指向位置的元素复制到 `slow` 位置上。
+ - 如果不相等,则将 `slow` 右移一位,将 `fast` 指向位置的元素赋值到 `slow` 位置上。
254
4. 将 `fast` 右移 `1` 位。
255
256
- 重复上述 3 ~ 4 步,直到 `fast` 等于数组长度。
0 commit comments