For this Question: You are given an array A of size N, and you are also given a sum. You need to find if two numbers in A exists such that their sum is equal to the given sum. If yes, print 1, else print 0.The first line contains N denoting the size of the array A and target sum. The second line contains N elements of the array. The third line contains element sum.

Constraints:
1 <= N <= 100000
1 <= A[i] <= 1000000Print 1, if there is an occurrence of the sum, else print 0.Sample Input
10 14
1 2 3 4 5 6 7 8 9 10

Sample Output
1

Explanation 
10 + 4 = 14,  so pair exists

Sample Input
5 9
1 2 3 4 5 

Sample Output 
1
, 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));
        String [] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int target = Integer.parseInt(input[1]);
        input = br.readLine().split(" ");
        int [] arr = new int[n];
        for(int i =0; i<n; i++){
           arr[i] = Integer.parseInt(input[i]);
        }
        Arrays.sort(arr);
        int pointerLeft = 0;
        int pointerRight = n-1;
        boolean value = false;
        while(pointerLeft<pointerRight){
            if(arr[pointerLeft] + arr[pointerRight] == target){
                System.out.println("1");
                value = true;
                break;
            }
            else if(arr[pointerLeft]+arr[pointerRight]<target){
                pointerLeft++;
            }
            else{
                pointerRight--;
            }
        }
        if(value == false){
           System.out.println("0");
        }

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