For this Question: Given an array Arr of N elements. Find the minimum number of elements that you need to delete from this array such that all the elements in the array become distinct.First line of input contains a single integer N.
Second line of input contains N space separated integers, denoting the array Arr.

Constraints:
1 <= N <= 100000
1 <= Arr[i] <= 10^9Print a single integer which is the minimum number of elements that must be deleted.Sample Input 1
6
1 1 2 2 3 3

Sample Output 1
3

Explanation: we will delete 1 of each 1, 2 and 3., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
public static void main (String[] args) throws IOException{
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        int N = Integer.parseInt(br.readLine());
        String[] arr = br.readLine().split(" ");
        int n = arr.length;
        int[] array1 = new int[n];
        for(int i = 0 ;i<n; i++){
            array1[i] = Integer.parseInt(arr[i]);
        }
        int res = 0;


    for (int i = 0; i < n; i++)
    {
        int j = 0;
        for (j = 0; j < i; j++)
            if (array1[i] == array1[j])
                break;
        if (i == j)
            res++;
    }
    System.out.print(n-res);

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