解法二:動態規劃(Dynamic Programming). class Solution: def climbStairs(self, n: int) -> int: if n == 1: return 1 if n == 2: return 2 dp = [0] * (n+1) dp[1] ...
確定! 回上一頁