Create 283. Move Zeroes.md#53
Open
fuga-98 wants to merge 1 commit into
Open
Conversation
oda
reviewed
May 28, 2025
| > 何も書いていない except は ^C で送られてくるシグナルさえ捕まえます。 | ||
| タイミングよく ^C を送ることで、括弧の対応関係を変えられるプログラム、セキュリティー的にもまずそうではないですか。 | ||
| > | ||
| - けっこう書いてました。地雷を埋め込んでました。 |
There was a problem hiding this comment.
まあ、そういう状況で使うことは起きないし、起きたとしたら全部書き換えるのだという覚悟が決まった上でやっているならばいいんですが、広い意味で「遠い帰結に想像がいくか」ということかなと思います。
nittoco
reviewed
May 31, 2025
| i -= 1 | ||
| continue | ||
| nums.append(0) | ||
| nums.pop(i) |
Owner
Author
There was a problem hiding this comment.
私も初めて使いました。O(N)かかるので注意です。
https://wiki.python.org/moin/TimeComplexity
nittoco
reviewed
May 31, 2025
| continue | ||
| nums.append(0) | ||
| nums.pop(i) | ||
| i -= 1 |
hroc135
reviewed
Jun 10, 2025
| non_zero_index += 1 | ||
| for i in range(non_zero_index, len(nums)): | ||
| nums[i] = 0 | ||
| return nums |
hroc135
reviewed
Jun 10, 2025
| https://github.com/hroc135/leetcode/pull/51/files | ||
|
|
||
| - こちらは私のと似ている | ||
| - これは同意。YAGNIでしょうか。仕事でも自分の昔の実装に邪魔されることがありました。 |
There was a problem hiding this comment.
What to look for in a code review にも同じことが書かれていますね。
A particular type of complexity is over-engineering, where developers have made the code more generic than it needs to be, or added functionality that isn’t presently needed by the system.
https://google.github.io/eng-practices/review/reviewer/looking-for.html#complexity
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/move-zeroes/description/