For this Question: Given an array of N elements, N is an even positive number. You have to make N/2 pairs among them such that each element is in exactly one pair. Score of a pair is the absolute difference between there values. Find the maximum sum of score of N/2 pairs.First Line of input contains N.
Second line of input contains N space seperated integers, denoting Arr.

Constraints:
1 <= N <= 100000
1 <= Arr[i] <= 1000000000
N will be evenPrint a single integer which is the maximum sum of score of N/2 pairs.Sample Input 1
2
1 2

Sample Output 1
1

Sample Input 2
4
1 4 2 4

Sample Output 2
5

Explanation: (1, 4) (2, 4) are the optimal pairs, I have written this Solution Code: import java.io.*;
import java.util.*;

public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader inputMachine = new BufferedReader(new InputStreamReader(System.in));
		int length = Integer.parseInt(inputMachine.readLine());
		String[] arrText = inputMachine.readLine().trim().split(" ");
		int[] nums = new int[length];
		for (int i = 0; i < nums.length; i++) {
			nums[i] = Integer.parseInt(arrText[i]);
		}
		Arrays.sort(nums);
		int i = 0;
		int j = length - 1;
		long sum = 0;
		while (i < j) {
			sum += nums[j] - nums[i];
			i++;
			j--;
		}
		System.out.println(sum);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?