For this Question: Given an array of N integers, give the number with maximum frequency. If multiple numbers have maximum frequency print the maximum number among them.The first line of the input contains an integer N, and the Second line contains N space-separated integers of the array.

<b>Constraints:</b>
3 <= N <= 1000
1 <= Arr[i] <= 100The output should contain single integer, the number with maximum frequency.If multiple numbers have maximum frequency print the maximum number among them.Sample Input
5
1 4 2 4 5

Sample Output
4

<b>Explanation:-</b>
4 has max frequency=2, 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=Integer.parseInt(br.readLine());
    String [] str=br.readLine().trim().split(" ");
	int a[]=new int[n];

	for(int i=0;i<n;i++){
		a[i]=Integer.parseInt(str[i]);
	}
	Arrays.sort(a);
	int size=a[n-1]+1;
	int c[]=new int[size];
	for(int i=0;i<size;i++) c[i]=0;
	for(int i=0;i<n;i++) c[a[i]]++;
	int max=0,freq=c[1];
	for(int i=2;i<size;i++){
		if(freq<=c[i]){
			freq=c[i];
			max=i;
		}
	}
	System.out.println(max);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?