For this Question: Given an array <b>nums</b> of N integers where each element is in between 1 to N. Your task is to print all the integers from 1 to N which are not present in the given array.First line contains n the length of input
Second line of input contains the array of integers in range from (1 to n)

<b> Constraints </b>
1 <= n <= 100000
1 <= arr[i] <= nPrint all the integers in range [1, n] that dose not appear in array.Sample Input :
5
1 2 3 4 4

Sample Output : 
5

Sample Input:
7
4 1 3 2 5 5 4

Sample Output:
6 7

Explaination:
In the first test, only 5 is the integer from 1 to n, which is missing from the array.
In the second test, both 6 and 7 are missing., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) {
        Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] arr=new int[n];
		for(int i=0;i<n;i++){
			arr[i]=sc.nextInt();
		}
		List<Integer> ans=missing(arr);
		for(int i=0;i<ans.size();i++){
			System.out.print(ans.get(i)+" ");
		}
		System.out.println();
	}
	  static List<Integer> missing(int[] arr){
        int i=0;
        while (i< arr.length){
            int correct=arr[i]-1;
            if (arr[i]!=arr[correct]){
                swap(arr,i,correct);
            }else {
                i++;
            }
        }
        List<Integer> ans=new ArrayList<>();
        for (int j = 0; j < arr.length; j++) {
            if (arr[j] != j+1) {
                ans.add(j + 1);
            }
        }
        return ans;
    }
    static void swap(int[] arr,int first,int second){
        int temp=arr[first];
        arr[first]=arr[second];
        arr[second]=temp;
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?