82. Remove Duplicates from Sorted List II.md#4
Open
X-XsleepZzz wants to merge 4 commits into
Open
Conversation
oda
reviewed
Jan 11, 2025
| (https://github.com/olsen-blue/Arai60/pull/4) | ||
|
|
||
| araiさんや他の人のgitを見るとdummyで書いていたが、sentinelは有名な呼び方じゃないのかな。 | ||
| sentinelで書こうと思ったがdummyという変数名で書くことにする。 |
There was a problem hiding this comment.
これはどちらでもいいでしょう。
もう少し書き方のオプションや何を引き継ぐ約束でループを回しているのかについて、考えるために下のドキュメントを貼っておきます。どこまで掘り下げるかはオプショナルです。
https://docs.google.com/document/d/11HV35ADPo9QxJOpJQ24FcZvtvioli770WWdZZDaLOfg/edit?tab=t.0#heading=h.xzxd7jwvkwc5
nodchip
reviewed
Jan 12, 2025
| node = head | ||
|
|
||
| while node is not None and node.next is not None: | ||
|
|
There was a problem hiding this comment.
while 文の直後に空行を入れるのはあまり見ないかもしれません。好みの問題かもしれません。
| last_fixed_node = last_fixed_node.next | ||
|
|
||
| node = node.next | ||
|
|
There was a problem hiding this comment.
関数内で空行を入れる際は 1 行のみとするのが良いと思います。
https://google.github.io/styleguide/pyguide.html#35-blank-lines
Use single blank lines as you judge appropriate within functions or methods.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
82. Remove Duplicates from Sorted List II
Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked list sorted as well.
次は2. Add Two Numbers