Skip to content

62. Unique Paths#30

Open
hiro111208 wants to merge 2 commits into
mainfrom
62-unique-paths
Open

62. Unique Paths#30
hiro111208 wants to merge 2 commits into
mainfrom
62-unique-paths

Conversation

@hiro111208
Copy link
Copy Markdown
Owner

This problem: 62. Unique Paths

Next problem: 63. Unique Paths

Comment thread 62_unique_paths/step1.md
```python
class Solution:
def uniquePaths(self, m: int, n: int) -> int:
grid = [[1] * n] + [[1] + [0] * (n - 1)] * (m - 1)
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_paths はいかがでしょうか?

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.

コメントありがとうございます。確かにgridでは中身の理解の助けにならないです。
num_pathsだと個人的にはpathsの数で単数形に聞こえてしまうので、pathsの数を複数格納していることをわかってもらえるようpath_countsにしようと思います。

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.

2 participants