Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
feikerwu authored and azl397985856 committed Jan 15, 2020
1 parent 5f32fb1 commit 34f3f06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion problems/80.remove-duplicates-from-sorted-array-ii.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ for (int i = 0; i < len; i++) {

- 初始化快慢指针 slow , fast ,全部指向索引为 0 的元素。
- fast 每次移动一格
- 满指针选择性移动,即只有写入数据之后才移动。是否写入数据取决于 slow - 2 对应的数字和 fast 对应的数字是否一致。
- 慢指针选择性移动,即只有写入数据之后才移动。是否写入数据取决于 slow - 2 对应的数字和 fast 对应的数字是否一致。
- 如果一致,我们不应该写。 否则我们就得到了三个相同的数字,不符合题意
- 如果不一致,我们需要将 fast 指针的数据写入到 slow 指针。
- 重复这个过程,直到 fast 走到头,说明我们已无数字可写。
Expand Down

0 comments on commit 34f3f06

Please sign in to comment.