
70. Climbing Stairs
·
Algorithm
Climbing Stairs - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. Dynamic Programming class Solution: def climbStairs(self, n: int) -> int: dp = [[0] * 2 for _ in range(46)] dp[1][0] = 1 dp[2][0] = 1 dp[2][1] = 1 for i in range(3, n + 1): dp[i][0] = sum(dp[i - 1]) dp[i][1] = sum..