For this Question: While Solo was playing with an array A of N integers, her little sister Tono asked her the following question:
For each integer i from 1 to N, find the smallest non- negative integer that is missing in subarray A[0]...A[i-1].

As Solo wants to play, please help her solve the following problem.The first line of the input contains a single integer N.
The second line of input contains N space-separated integers, the integers of the array A.

Constraints
1 <= N <= 200000
0 <= A[i] <= 200000Output N integers, the answers for each index <b>i</b> in a new line.Sample Input
4
1 1 0 2

Sample Output
0
0
2
3

Explanation:
For i=1, subarray = [1], smallest non negative missing integer = 0.
For i=2, subarray = [1, 1], smallest non negative missing integer = 0.
For i=3, subarray = [1, 1, 0], smallest non negative missing integer = 2.
For i=4, subarray = [1, 1, 0, 2], smallest non negative missing integer = 3.

Sample Input
10
5 4 3 2 1 0 7 7 6 6

Sample Output
0
0
0
0
0
6
6
6
8
8, 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 N = Integer.parseInt(read.readLine());
		StringTokenizer st = new StringTokenizer(read.readLine());

		int[] arr = new int[N];
		for(int i=0; i<N; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
		}

		int[] prefixArr = new int[200010];
		int minIndex = 0;

		for(int i=0; i<N; i++) {
			prefixArr[i] = -1;
		}

		for(int i=0; i < N; i++) {
			prefixArr[arr[i]] = arr[i];
			while(minIndex < N && prefixArr[minIndex] != -1) {
				minIndex++;
			}
			System.out.println(minIndex);
		}

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