Skip to content

82. Remove Duplicates from Sorted List II#4

Open
rimokem wants to merge 1 commit into
mainfrom
0082-remove-duplicates-from-sorted-list-ii
Open

82. Remove Duplicates from Sorted List II#4
rimokem wants to merge 1 commit into
mainfrom
0082-remove-duplicates-from-sorted-list-ii

Conversation

@rimokem
Copy link
Copy Markdown
Owner

@rimokem rimokem commented Mar 24, 2026

Comment thread 0082/memo.md
- 重複があれば、一つになるまで削除したのちに、`node.next`を1個先に付け替える。

- 先頭に重複があると、上記だけでは不十分。
- いろいろ考えたが、`head`の先頭に仮のノードを置けば、統一的に処理できる。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この問題で追加で考えてほしいのは、ループを回すということは、仕事の引き継ぎのようなものとすると、引き継ぐときに何を約束しているかです。
たとえば、下のコードは node.next が次に処理したいやつであることを約束して引き継いでいますね。
そういうことは読み取らないとコードが読めないです。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants