Skip to content

Decode Ways#147

Open
tom4649 wants to merge 1 commit into
mainfrom
91.Decode-Ways
Open

Decode Ways#147
tom4649 wants to merge 1 commit into
mainfrom
91.Decode-Ways

Conversation

@tom4649

@tom4649 tom4649 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Comment thread 0091.Decode-Ways/memo.md
return 0

# パターン1: 1文字としてデコードする
ans = dfs(i + 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.

ans は、設問に対する解答というニュアンスを感じます。このプログラムの世界の外側の世界、 LeetCode の概念が混ざっているように感じられて、違和感を感じます。このプログラムの世界観の中で、この変数の中に格納される値を、端的な英単語・英語句で表した変数名を付けたほうが良いように思います。 num_ways はいかがでしょうか?

for i in range(len(s)):
if s[i] == "0":
continue
dp[i+1] += dp[i]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

こちらのコメントをご参照ください。
mt2324/leetcode#2 (comment)

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