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

[pull] main from itcharge:main #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
pull merged 1 commit into AlgorithmAndLeetCode:main from itcharge:main
Jul 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update 01.Array-Two-Pointers.md
  • Loading branch information
杨世超 committed Jul 14, 2022
commit 9c85dbe68d294958e20af457044ecfd3ed8587db
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ return 合适的值
1. 定义两个快慢指针 `slow`,`fast`。其中 `slow` 指向去除重复元素后的数组的末尾位置。`fast` 指向当前元素。
2. 令 `slow` 在后, `fast` 在前。令 `slow = 0`,`fast = 1`。
3. 比较 `slow` 位置上元素值和 `fast` 位置上元素值是否相等。
- 如果不相等,则将 `slow` 后移一位,将 `fast` 指向位置的元素复制到 `slow` 位置上。
- 如果不相等,则将 `slow` 右移一位,将 `fast` 指向位置的元素赋值到 `slow` 位置上。
4. 将 `fast` 右移 `1` 位。

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

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