For this Question: Given an integer array A of size N. You can choose a set of integers and remove all the occurrences of these integers in the array. Find the minimum size of the set so that at least half of the integers of the array are removed.First line contains an integer N.
Next line contains N space separated integers denoting elements of array.

Constraints
1 <= N <= 10^5
N is even.
1 <= Ai<= 10^5Print a single integer - the minimum size of the set.Sample Input 1:
4
7 7 7 7

Output 
1

Explanation:
The only possible set you can choose is {7}. This will make the new array empty.
 
Sample Input 2:
8
3 3 3 5 5 2 2 7

Output 
2

Explanation
Choosing {3, 7} will make the new array [5, 5, 5, 2, 2] which has size 5 (i. e equal to half of the size of the old array)., I have written this Solution Code: import java.io.*;
import java.util.*;

class Main
{
    public static void main (String args[]) throws IOException
    {
        BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
        int n;
		n = Integer.parseInt(br.readLine());
		int arr[] = new int[n];
		    String line = br.readLine();
		    String[] strs = line.trim().split("\\s+");
		    for (int i = 0; i < n; i++) {
		         arr[i] = Integer.parseInt(strs[i]);
		    }
        Map<Integer,Integer> hm = new HashMap<>();

        for (int x: arr){
            hm.put(x,hm.getOrDefault(x,0)+1);
        }

        PriorityQueue<Map.Entry<Integer,Integer>> maxHeap = new PriorityQueue<>((a,b)->b.getValue()-a.getValue());

        for(Map.Entry<Integer,Integer> entry: hm.entrySet()){
            maxHeap.add(entry);
        }
        int result = 0;
        int counter = 0;
        while (!maxHeap.isEmpty()){
            if (counter>=arr.length/2){
                break;
            }
            Map.Entry<Integer,Integer> tmp = maxHeap.poll();
            counter+=tmp.getValue();
            result++;
        }
        System.out.print(result);
    }
}

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