【Leetcode】70. Climbing Stairs

经典的爬楼梯问题 方法1 DP dp法,经典dp,注意初始值即可。 dp法是一种from bottom to top 的方法 class Solution1: def climbStairs(self, n): """ :type n: int :rtype: int """ if n == 1: return 1 i
相关文章
相关标签/搜索