mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-05 04:04:22 +00:00
Re-translate the Japanese version (#1871)
* Retranslate Japanese docs with GPT-5.4 * Retranslate Japanese code with GPT-5.4
This commit is contained in:
@@ -6,8 +6,8 @@ Author: krahets (krahets@163.com)
|
||||
|
||||
|
||||
def dfs(i: int) -> int:
|
||||
"""探索"""
|
||||
# 既知の dp[1] と dp[2] は、それらを返す
|
||||
"""検索"""
|
||||
# dp[1] と dp[2] は既知なので返す
|
||||
if i == 1 or i == 2:
|
||||
return i
|
||||
# dp[i] = dp[i-1] + dp[i-2]
|
||||
@@ -20,9 +20,9 @@ def climbing_stairs_dfs(n: int) -> int:
|
||||
return dfs(n)
|
||||
|
||||
|
||||
"""ドライバーコード"""
|
||||
"""Driver Code"""
|
||||
if __name__ == "__main__":
|
||||
n = 9
|
||||
|
||||
res = climbing_stairs_dfs(n)
|
||||
print(f"{n} 段登り、合計 {res} 通りの解がある")
|
||||
print(f"{n} 段の階段を上る方法は全部で {res} 通りです")
|
||||
|
||||
Reference in New Issue
Block a user