Skip to content

994. Rotting Oranges - #102

Open
kitano-kazuki wants to merge 1 commit into
mainfrom
994-rotting-oranges
Open

994. Rotting Oranges#102
kitano-kazuki wants to merge 1 commit into
mainfrom
994-rotting-oranges

Conversation

@kitano-kazuki

Copy link
Copy Markdown
Collaborator

Comment thread memo.md
minutes += 1
for r, c in rotten_oranges:
for dr, dc in [(1, 0), (0, 1), (-1, 0), (0, -1)]:
if r + dr < 0 or len(grid) <= r + dr or c + dc < 0 or len(grid[0]) <= c + dc:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

数直線上に一直線上に並ぶように並べたほうが、読み手にとって理解しやすくなると思います。

if not (0 <= r + dr < len(grid) and 0 <= c + dc < len(grid[0])):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

確かにこの方が良さそうです

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