Skip to content

Count ways to reach the n’th stair #5

@acha-bill

Description

@acha-bill

There are N stairs. A person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs at a time.

Write a function, that counts the number of ways the person can reach the top.

For example, in the image below, there are 4 steps(levels). The person starts at step 1.

nth-stair
As you can see, there are 3 ways to reach the 4th step by climbing either 1 or 2 steps at a time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    L3Level 3L4Level 4

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions