Skip to content

Conversation

@Fuminiton
Copy link
Owner


for i in range(1, len(s) + 1):
for word in wordDict:
if not 0 <= i - len(word) < len(s):
Copy link

Choose a reason for hiding this comment

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

i - len(word) は一回変数に置き直したほうがいいでしょう。

s.endswith(word, 0, i) のほうが直感的ですかねー。

Copy link
Owner Author

Choose a reason for hiding this comment

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

レビューありがとうございます。

i - len(word) は一回変数に置き直したほうがいいでしょう。

word_start_indexと変数においてしまった方が分かりやすいですね。


while indices:
next_indices = []
for index in indices:
Copy link

Choose a reason for hiding this comment

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

自分だったらここ、start_index. start_indicesにすると思いました。

Copy link
Owner Author

Choose a reason for hiding this comment

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

レビューありがとうございます。
start_indexとして方が、何を比較しているか見えるので良いですね。

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.

4 participants