Skip to content

【Arai60】60問目 6. Zigzag Conversion#60

Merged
shining-ai merged 2 commits intomainfrom
review60
Jun 29, 2024
Merged

【Arai60】60問目 6. Zigzag Conversion#60
shining-ai merged 2 commits intomainfrom
review60

Conversation

@shining-ai
Copy link
Copy Markdown
Owner

Copy link
Copy Markdown

@nodchip nodchip left a comment

Choose a reason for hiding this comment

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

よいと思います。

if numRows == 1:
return s
rows = [[] for _ in range(numRows)]
num_row = 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.

num_rowとnumRowsの違いがわからないので、num_row -> row_indexとかでどうでしょう。

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

確かにnum_rowは不親切な名前な気がしてきました。

merged_all_rows = []
for row in rows:
merged_all_rows.extend(row)
return "".join(merged_all_rows)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"".join(for c in row for row in rows)みたいにできそうですね。

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

こちらの記述で表せました。

"".join(c for row in rows for c in row)

@shining-ai shining-ai merged commit 1c14d33 into main Jun 29, 2024
@shining-ai shining-ai deleted the review60 branch June 29, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants