Skip to content

字节&leetcode70:爬楼梯问题 #90

Description

@sisterAn

假设你正在爬楼梯。需要 n 阶你才能到达楼顶。

每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢?

注意: 给定 n 是一个正整数。

示例 1:

输入: 2
输出: 2
解释: 有两种方法可以爬到楼顶。
1. 1  + 1 
2. 2 

示例 2:

输入: 3
输出: 3
解释: 有三种方法可以爬到楼顶。
1. 1  + 1  + 1 
2. 1  + 2 
3. 2  + 1 

附赠leetcode地址:leetcode

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions