For this Question: You are given an array A (distinct integers) of size N, and you are also given a sum. You need to find if two numbers in A exists that have sum equal to the given sum.The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains two lines of input. The first line contains N denoting the size of the array A and target sum. The second line contains N elements of the array.

Constraints:
1 <= T <= 100
1 <= N <= 10^4
1 <= sum <= 10^5
1 <= A[i] <= 10^4For each testcase, in a new line, print  "1"(without quotes) if any pair found, othwerwise print "0"(without quotes) if not found.Sample Input
2
10 14
1 2 3 4 5 6 7 8 9 10
2 10
2 5

Sample Output
1
0

Explanation:
Testcase 1: arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and sum = 14.  There is a pair {4, 10} with sum 14.
Testcase 2: arr[]  = {2, 5} and sum = 10. There is no pair with sum 10., I have written this Solution Code: import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework

// don't change the name of this class
// you can add inner classes if needed
class Main {
	public static void main (String[] args) {
                      // Your code here
        Scanner sc = new Scanner(System.in);
        int testCases = sc.nextInt();

        for(int i = 1; i <= testCases; i++)
        {
            int arrSize = sc.nextInt();
            int sum = sc.nextInt();
            int arr[] = new int[arrSize];

            for(int j = 0; j < arrSize; j++)
                arr[j] = sc.nextInt();
            System.out.println(pairFound(arr, arrSize, sum));   
        }
	}

    static int pairFound(int arr[], int arrSize, int sum)
    {
        HashSet<Integer> hSet = new HashSet<>();
        for(int i = 0; i < arrSize; i++)
        {
            if(hSet.contains(sum-arr[i]) == true)
               return 1;
            hSet.add(arr[i]);
        }

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