For this Question: Given a linked list consisting of <b>L</b> nodes and given a number <b>N</b>. The task is to find the Nth node from the end of the linked list.First line of input contains number of testcase T. For each testcase, first line of input contains number of nodes in the linked list L and the number N. Next line contains N nodes of linked list.

<b>User Task:</b>
The task is to complete the function <b>getNthFromLast()</b> which takes two arguments: reference to head and N and you need to return Nth from end.

<b>Constraints:</b>
1 <= T <= 100
1 <= N <= L <= 10^3
For each testcase, output the data of node which is at Nth distance from end.Input:
2
9 2
1 2 3 4 5 6 7 8 9
4 5
10 5 100 5

Output:
8
-1

Explanation:
Testcase 1: In the first example, there are 9 nodes in linked list and we need to find 2nd node from end.  2nd node from end os 8.  
Testcase 2: In the second example, there are 4 nodes in linked list and we need to find 5th from end.  Since 'n' is more than number of nodes in linked list, output is -1., I have written this Solution Code: static int getNthFromLast(Node head, int n)
    {

        int len = 0;
        Node temp = head;
        while(temp != null)                 // Traverse temp throught the linked list and find the length
        {
            temp = temp.next;
            len++;
        }
        if(len < n)
            return -1;
        //System.out.println(count);
        //int r = count - n;
        temp = head;
        for(int i=1; i<len-n+1; i++)            // Traverse the node till the position from begining:   length - n +1.
            temp = temp.next;
        return temp.data;

    }, In this Programming Language: Java, Now tell me if this Code is compilable or not?