Question: c + + You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2
c You are climbing a staircase. It takes n steps to reach the top.
Each time you can either climb or steps. In how many distinct ways can you climb to the top?
Example :
Input: n
Output:
Explanation: There are two ways to climb to the top.
step step
steps
Example :
Input: n
Output:
Explanation: There are three ways to climb to the top.
step step step
step steps
steps step
Constraints:
n
Seen this question in a real interview before?
Yes
No
Accepted
M
Submissions
M
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
