For this Question: Linear probing is a collision handling technique in hashing. Linear probing says that whenever a collision occurs, search for the immediate next position.

In this question, we'll learn how to fill up the hash table using linear probing technique. You are given hash table size which you'll use to insert elements into their correct position in the hash table i.e.(arr[i]%hashSize). You are also given an array arr of size n. You need to fill up the hash table using linear probing and print the resultant hash table.

Note: All the positions that are unoccupied are denoted by -1 in the hash table.
If there is no more space to insert, then just drop that element.The first line of input contains T denoting the number of test cases. T-test cases follow. Each test case contains 2 lines of input. The first line contains the size of the hashtable and the size of the array. The third line contains elements of the array.

<b>Constraints:-</b>
1 &le; T &le; 100
1 &le; hashSize &le; 10<sup>3</sup>
1 &le; sizeOfArray &le; 10<sup>3</sup>
0 &le; Array[] &le; 10<sup>5</sup>
For each testcase, in a new line, print the hash table as shown in example.Input:
2
10 4
4 14  24 44
10 4
9 99 999 9999

Output:
-1 -1 -1 -1 4 14 24 44 -1 -1
99 999 9999 -1 -1 -1 -1 -1 -1 9

Explanation:
Testcase1: 4%10=4. So put 4 in hashtable[4]. Now, 14%10=4, but hashtable[4] is already filled so put 14 in the next slot and so on.
Testcase2: 9%10=9. So put 9 in hashtable[9]. Now, 99%10=9, but hashtable[9] is already filled so put 99 in the (99+1)%10 =0 slot so 99 goes into hashtable[0] and so on., I have written this Solution Code: import java.io.*;
import java.util.*;



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

        BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(read.readLine());
        while(t-- > 0){
            String str[] = read.readLine().trim().split("\\s+");
            int hashSize = Integer.parseInt(str[0]);
            int N = Integer.parseInt(str[1]);
            int arr[] = new int[N];
            str = read.readLine().trim().split("\\s+");
            for(int i = 0; i < N; i++){
                arr[i] = Integer.parseInt(str[i]);
            }

            int hashTable[] = new int[hashSize];
            for(int i=0; i<hashSize; i++){
                hashTable[i] = -1;
            }

            for(int i = 0; i< Math.min(N, hashSize); i++){
                int idx = arr[i] % hashSize;
                int j = 0;
                while(hashTable[(idx + j) % hashSize] != -1){
                    j++;
                }
                hashTable[(idx + j) % hashSize] = arr[i];
            }

            for(int i=0; i<hashSize; i++){
                System.out.print(hashTable[i] +" ");
            }
             System.out.println();

        }

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