Skip to content

283. Move Zeroes#55

Open
kitano-kazuki wants to merge 1 commit into
mainfrom
283-move-zeroes
Open

283. Move Zeroes#55
kitano-kazuki wants to merge 1 commit into
mainfrom
283-move-zeroes

Conversation

@kitano-kazuki
Copy link
Copy Markdown
Owner

Comment thread memo.md
for i in range(non_zero_tail, len(nums)):
nums[i] = 0

return
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

returnを省略した方が一般的ですかね。

Comment thread memo.md
"""
Do not return anything, modify nums in-place instead.
"""
non_zero_tail = 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

非ゼロの末尾というより、非ゼロを次に書き込む場所といった方が読み取りやすいでしょうか。

nums[:non_zero_tail]が、非ゼロの配列になるので、間違いではないとは思います。

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants