Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9c85dbe

Browse files
author
杨世超
committed
Update 01.Array-Two-Pointers.md
1 parent 30bc228 commit 9c85dbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎Contents/01.Array/04.Array-Two-Pointers/01.Array-Two-Pointers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ return 合适的值
250250
1. 定义两个快慢指针 `slow`,`fast`。其中 `slow` 指向去除重复元素后的数组的末尾位置。`fast` 指向当前元素。
251251
2.`slow` 在后, `fast` 在前。令 `slow = 0`,`fast = 1`
252252
3. 比较 `slow` 位置上元素值和 `fast` 位置上元素值是否相等。
253-
- 如果不相等,则将 `slow` 后移一位,将 `fast` 指向位置的元素复制到 `slow` 位置上。
253+
- 如果不相等,则将 `slow` 右移一位,将 `fast` 指向位置的元素赋值到 `slow` 位置上。
254254
4.`fast` 右移 `1` 位。
255255

256256
- 重复上述 3 ~ 4 步,直到 `fast` 等于数组长度。

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /