Conversation
oda
reviewed
Jan 11, 2026
| - dictの命名でkey_to_valueはとても良いので毎回候補の中に入れるようにしたい | ||
| - checked_は今回のような短いコードの場合はすぐわかるので書かなくて良さそう | ||
| - step1-2でミスでtupleで返してもLeetCode的にOKになっていた | ||
| - 内部的にどういう感じでOK/NGの判定をしているのかイメージしたところfor文で判定してたりするとこのような現象が起こりそうだと思った |
There was a problem hiding this comment.
予想として、順序が違っても正解にしたいので
expected == sorted(actual) とかにしているのではないですかね。
| - https://github.com/mamo3gr/arai60/pull/11/files | ||
| - 配列の長さが0,1の時エラーを投げてるのはいいと思う | ||
| - エラーを返すかNoneを返すか毎回悩む | ||
| - `complement`は全く選択肢に出てこなかったので調べた |
There was a problem hiding this comment.
単語を知らないのは仕方がないし、実際の仕事の場面では調べるなどできると思います。
どう考えるか、どういう価値観を持つかを気にしましょう。
mamo3gr
reviewed
Jan 11, 2026
| return [num_to_index[complemnt], index] | ||
| num_to_index[num] = index | ||
|
|
||
| return |
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.
問題
Two Sum
次に解く問題
Group Anagrams