Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started