Create 83. Remove Duplicates from Sorted List.md#2
Open
Rinta-Rinta wants to merge 1 commit intomainfrom
Open
Conversation
oda
reviewed
Jan 11, 2026
| araiさんの動画を見てみた。 | ||
| https://www.youtube.com/watch?v=foMqZAL00UU | ||
| アルゴリズム自体は自分と同じだったが、動画ではサイクルについて言及されていた。自分はサイクルについて考えなかったので、参考になった。 | ||
| 参考になったが、ソートされててサイクルがあるってどういうことなんだと感じた。 |
There was a problem hiding this comment.
これ、どちらかというと「ゴミを突っ込まれたときの動作」が気になっていると思います。
https://docs.google.com/document/d/11HV35ADPo9QxJOpJQ24FcZvtvioli770WWdZZDaLOfg/edit?tab=t.0#heading=h.jdtk9v35bca4
気持ちとして「止まらない」というのが一番嫌なんですね。変な値が返って来るのだとまだしようがあるけれども、止まらないとどうしようもないので。
Owner
Author
There was a problem hiding this comment.
コメントありがとうございます。
動くか、動かないかだけでなく、実際に使う場面やそこで生じるエラーまで想像できているかが、このような視点を生むんですね。
すごく納得し勉強になりました。
There was a problem hiding this comment.
まあ、もちろん、すべてをバリデートするわけにはいきません(例えば二分探索ができる確認のために全要素を確認したら意味がない)が、しかし、ゴミを入れられたら何が起きるかは常にうっすら考えているわけです。
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.
この問題
https://leetcode.com/problems/remove-duplicates-from-sorted-list/description/