For this Question: Given an array of N integers, an integer X, and Q queries. For each query, you will be given an integer K. Your task is to find the Kth occurrence of the number X in the array. If the Kth occurrence does not exist print -1.The first line of input contains three integers N, X, and Q. The second line of input contains N space- separated integers. The Next Q lines of input contain a single integer each representing K.

Constraints:-
1 <= Q, K, N <= 100000
1 <= X, Arr[] <= 100000For each query in a new line print the index of the Kth occurrence. If the Kth occurrence does not exist print -1.Sample Input:-
10 3 4
1 2 3 4 2 3 4 5 2 3
1
2
3
4

Sample Output:_
3
6
10
-1, I have written this Solution Code: import java.io.*;
import java.util.*;



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

					  BufferedReader inp = new BufferedReader(new InputStreamReader(System.in));
					  String[] NXQ = inp.readLine().split("\\s+");
					  int N = Integer.parseInt(NXQ[0]);
					  int X = Integer.parseInt(NXQ[1]);
					  int Q = Integer.parseInt(NXQ[2]);
					  String[] StrArr = inp.readLine().split("\\s+");
					  int[] arr = new int[N];
					  ArrayList<Integer> posX = new ArrayList<>();
					  int j = 0;
					  for (int i = 0; i < N; i++) {
						  arr[i] = Integer.parseInt(StrArr[i]);
						  if (arr[i] == X) {
							  posX.add(i + 1);
						  }
					  }
					  for (int i = 0; i < Q; i++) {
						  int query = Integer.parseInt(inp.readLine());
						  if (query > posX.size()) {
							  System.out.println("-1");
						  }
						  else {
							  System.out.println(posX.get(query - 1));
						  }
					  }


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