Michael has a beautiful house. There is only one
staircase to reach his bedroom. He used
to
climb either 1 stair or 2 stairs at a time. If-we
consider all possible combinations of climbing,
in how many ways can Michael reach to the top?
• Input Format
An Integer P denotes the number of stairs in the
staircase
If the number of stairs beyond 20. the output
should
print "Wrong Infrastructure
Output Format
The number of ways Michael can climb the
staircase to reach to the top
Constraints
Sample1:
input 5
output 8
sample 2
input 22
output wrong infrastructure
Answers
Answered by
0
Explanation:
Michael has a beautiful house. There is only one
staircase to reach his bedroom. He used
to
climb either 1 stair or 2 stairs at a time. If-we
consider all possible combinations of climbing,
in how many ways can Michael reach to the top?
• Input Format
An Integer P denotes the number of stairs in the
staircase
If the number of stairs beyond 20. the output
should
print "Wrong Infrastructure
Output Format
The number of ways Michael can climb the
staircase to reach to the top
Constraints
Sample1:
input 5
output 8
sample 2
input 22
output wrong infrastructure
Similar questions