For this Question: Given an array containing N integers and an integer K. Your task is to find the length of the longest Sub-Array with sum of the elements equal to the given value K.The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. The first line of each test case contains two integers N and K and the second line contains N space-separated elements of the array.

Constraints:-
1<=T<=500
1<=N,K<=10^5
-10^5<=A[i]<=10^5

Sum of N over all test cases does not exceed 10^5For each test case, print the required length of the longest Sub-Array in a new line. If no such sub-array can be formed print 0.Sample Input:
3
6 15
10 5 2 7 1 9
6 -5
-5 8 -14 2 4 12
3 6
-1 2 3

Sample Output:
4
5
0, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) {

                      Scanner sc=new Scanner(System.in);
                      int t=sc.nextInt();
                      while(t-->0){
                          if(t%10==0){
                          System.gc();
                          }
                          int arrsize=sc.nextInt();
                          int k=sc.nextInt();
                          int[] arr=new int[arrsize];
                          for(int i=0;i<arrsize;i++){
                              arr[i]=sc.nextInt();
                          }
                          int subsize=0;
                          int sum=0;
                          HashMap<Integer, Integer> hash=new HashMap<>();
                          for(int i=0;i<arrsize;i++){
                              sum+=arr[i];
                              if(sum==k){
                                  subsize=i+1;
                              }
                              if(!hash.containsKey(sum)){
                                  hash.put(sum,i);
                              }
                              if(hash.containsKey(sum-k)){
                                  if(subsize<(i-hash.get(sum-k))){
                                      subsize=i-hash.get(sum-k);
                                  }
                              }
                          }
                          System.out.println(subsize);
                      }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?