For this Question: You are given an array of 3N integers and you have to find a subsequence of length 2N of that array such that the ((sum of first N elements of that subsequence) - (sum of last N elements of that subsequence))  is maximum possible. Find that maximum value.First  Line of input contains single integer N 
Second line of input contains 3N space  separated integers denoting the  Array

Constraints 
1 <= N <= 100000
1 <= Arr[i] <= 1000000000Output a single integer which is the maximum value of ((sum of first N elements of that subsequence) - (sum of last N elements of that subsequence))Sample Input 1 
2
3 1 4 1 5 9

Sample Output 1 
1

Explaination 1
sequece  selected  : 3 4 1 5


Sample Input 2 
1
1 2 3

Sample Output 2 
-1

Explaination 2
sequece  selected  : 1 2, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) {
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        int al = 3*n;
        int arr[] = new int[al];
        long leftArr[] = new long[al];
        long rightArr[] = new long[al];
        for(int i = 0; i < arr.length; i++)
        arr[i] = sc.nextInt();

        long leftSum = 0;
        long rightSum = 0;
        PriorityQueue<Integer> leftPq = new PriorityQueue<>();
        PriorityQueue<Integer> rightPq = new PriorityQueue<>(Collections.reverseOrder());

        for (int i = 0; i < n; i++) {
            leftSum += arr[i];
            leftPq.add(arr[i]);
        }
        for (int i = al-1; i >= 2*n; i--) {
            rightSum += arr[i];
            rightPq.add(arr[i]);
        }
        leftArr[n-1] = leftSum;
        for (int i = n; i < 2*n; i++) {
            leftPq.add(arr[i]);
            leftSum += arr[i];
            leftSum -= leftPq.poll();
            leftArr[i] = leftSum;
        }
        rightArr[2*n]= rightSum;
        for (int i = 2*n-1; i >= n; i--) {
            rightPq.add(arr[i]);
            rightSum += arr[i];
            rightSum -= rightPq.poll();
            rightArr[i] = rightSum;
        }
        long ans = Integer.MIN_VALUE;
        for (int i = n-1; i <= 2*n-1 ; i++) {
            ans = Math.max(ans,leftArr[i]-rightArr[i+1]);
        }
        System.out.println(ans);
    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(
                    new InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() { return Integer.parseInt(next()); }

        long nextLong() { return Long.parseLong(next()); }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try {
                if(st.hasMoreTokens()){
                    str = st.nextToken("\n");
                }
                else{
                    str = br.readLine();
                }
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?