For this Question: Given an array of length N in which you can swap two elements if their sum is odd i.e for every i (1 to N) and j (1 to N) if (Arr[i] + Arr[j]) is odd then you can swap these elements.
What is the lexicographically smallest array you can obtain?First line of input contains a single integer N. Next line contains N space separated integers depicting the elements of the array.

Constraints:-
1 <= N <= 100000
1 <= Arr[i] <= 100000Print N space separated elements i. e the array which is the lexicographically smallest possibleSample Input:-
3
4 1 7

Sample Output:-
1 4 7

Explanation:-
Swap numbers at indices 1 and 2 as their sum 4 + 1 = 5 is odd

Sample Input:-
2
2 4

Sample Output:-
2 4

Sample Input:-
2
5 3

Sample Output:-
5 3, 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());
        String array[] = br.readLine().trim().split(" ");

        StringBuilder sb = new StringBuilder("");

        int[] arr = new int[n];
        int oddCount = 0,
            evenCount = 0;

        for(int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(array[i]);

            if(arr[i] % 2 == 0)
                ++evenCount;
            else
                ++oddCount;
        }

        if(evenCount > 0 && oddCount > 0)
            Arrays.sort(arr);

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

        System.out.println(sb.substring(0, sb.length() - 1));
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?