Count ways to reach the n'th stair
Submissions: 19174   Accuracy:

30.61%

  Difficulty: Medium   Marks: 4
Associated Course(s):   Interview Preparation

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 (order does matter).

Input:
The first line contains an integer 'T' denoting the total number of test cases. In each test cases, an integer N will be given.

Output:
For each testcase, in a new line, print number of possible ways to reach Nth stair. Answer your output % 10^9+7.

Constraints:
1<=T<=105
1<=N<=105

Example:
Input:
3
4
10
24
Output:
5
89
75025

** For More Input/Output Examples Use 'Expected Output' option **

Author: abhiraj26


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.