hacktoberfest2021
hacktoberfest2021 copied to clipboard
Count ways to reach the n’th stair
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. Count the number of ways, the person can reach the top.
Examples:
Input: n = 1 Output: 1 There is only one way to climb 1 stair
Input: n = 2 Output: 2 There are two ways: (1, 1) and (2)
Input: n = 4 Output: 5 (1, 1, 1, 1), (1, 1, 2), (2, 1, 1), (1, 2, 1), (2, 2)
Consider the example shown below in the diagram. The value of n is 3. There are 3 ways to reach the top.
I WANT TO ADD THIS PROBLEM TO DP SECTION
PLEASE ASSIGN THIS PROBLEM TO ME THANK YOU
Please assing me this issue. I might have most optimised approach to this problem
PLEASE Accept MY PR . THANK U.