For this Question: You will be given an array A of n integers, you need to rearrange the array to the lexicographically smallest array such that the elements of array appear in the following manner:
A[0] >= A[1] <= A[2] >= A[3] <= A[4] ....The first line of input contains an integer n, the number of elements in array.
The next line contains n integers, the elements of the array.

Constraints
1 <= n <= 100000
1 <= A[i] <= 1000000000Output the required array with space separated integers.Sample Input
4
3 2 1 4

Sample Output
2 1 4 3

Explanation
Other possible array satisfying the condition is [4 1 3 2] but that is not lexicographically smallest., 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().trim());
		int arr[] = new int[n];
		    String inputLine[] = br.readLine().trim().split(" ");
		    for(int i=0; i<n; i++){
		        arr[i]=Integer.parseInt(inputLine[i]);
		    }




		    Strange obj = new Strange();
			obj.convert(arr, n);

		    StringBuffer sb = new StringBuffer();
            for (int i = 0; i < n; i++)
                sb.append(arr[i] + " ");

		    System.out.println(sb);

	}



}
class Strange{



    public static void convert(int arr[], int n){

       Arrays.sort(arr);
       for(int i=0;i<=n-2;i+=2){
           int temp=arr[i];
           arr[i]=arr[i+1];
           arr[i+1]=temp;
       }

    }

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