For this Question: A child is running up a staircase with n steps and can hop either 1 step, 2 steps or 3 steps at a time. Implement a method to count how many possible ways the child can run-up to the stairs. You need to return all possible number of ways.
The time complexity of your code should be O(n).
Print answer modulo 10^9 + 7.The input line contains T, denoting the number of testcases.  Each testcase contains single line containing N, i.e. stairs having number of steps.  

Constraints
1 <= T <= 10
1 <= N <= 10^5Find the total number of ways. Since the answer can be very large, thus print them as modulo 10^9 + 7.Sample Input
2
4
3

Sample output
7
4

Explanation:
Testcase 1:
In this case we have stairs with 4 steps. So we can figure out how many ways are there to reach at the top.
1st: (1, 1, 1, 1)
2nd: (1, 1, 2)
3rd: (1, 2, 1)
4th: (1, 3)
5th: (2, 1, 1)
6th:  (2, 2)
7th: (3, 1), I have written this Solution Code: import java.io.*;
import java.util.*;




class Main {















	public static long waysBottomUp(int n, long dp[]){
		for(int i=4; i<=n; i++){
			dp[i]= ((dp[i-1]%1000000007) + (dp[i-2]%1000000007) + (dp[i-3]%1000000007))%1000000007;
		}
		return dp[n];
	}

	public static void main (String[] args)throws IOException {

		BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
		long dp[] = new long[100001];
		int t = Integer.parseInt(rd.readLine());
		while(t-->0){
		int n = Integer.parseInt(rd.readLine());
		dp[0] =1;
		dp[1] = 1;
		dp[2] = 2;
		dp[3] = 4;


		System.out.println(waysBottomUp(n, dp)%1000000007);}
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?