For this Question: We are given a list Arr[] of integers representing a list compressed with run-length encoding.

Consider each adjacent pair of elements [freq, val] = [Arr[2*i], Arr[2*i+1]] (with i >= 0).  For each such pair, there are freq elements with value val concatenated in a subarray. Concatenate all the subarray from left to right to generate the decompressed array.

Print the decompressed array.The input line contains T, denoting the number of testcases. Each testcase contains 2 lines. The first line contains size of array. Second line contains elements of array separated by space.

Note: size of input array is even

Constraints:
1 <= T <= 100
2 <= N <= 100
0 <= Arr[i] <= 100For each testcase you need to print the decompressed array in a new line.Sample Input:
2
4
1 2 3 4
4
1 1 2 3

Sample Output:
2 4 4 4
1 3 3

Explanation:
Testcase 1: The first pair [1,2] means we have freq = 1 and val = 2 so we generate the array [2].
The second pair [3,4] means we have freq = 3 and val = 4 so we generate [4,4,4].
At the end the concatenation [2] + [4,4,4] is [2,4,4,4]., I have written this Solution Code: import java.util.*;
import java.io.*;
import java.lang.*;

class Main
{
    public static void main(String args[])throws IOException
    {
            BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
            int t = Integer.parseInt(read.readLine());


        while(t-- > 0)
        {
           int N = Integer.parseInt(read.readLine());
           String str[] = read.readLine().trim().split(" ");
           int arr[] = new int[N];
           for(int i = 0; i < N; i++)
             arr[i] = Integer.parseInt(str[i]);

             int res[] = new int[decompress_EncodedArray(arr, N).length];
              res = decompress_EncodedArray(arr, N);
             //Collections.addAll(list, );
             print(res);
             System.out.println();

        }
    }

    static void print(int list[])
    {
        for(int i = 0; i < list.length; i++)
          System.out.print(list[i] + " ");

    }

    public static int [] decompress_EncodedArray(int[] nums, int n) {

    int[] intArr=null;
    
    int opArrSize=0;
    int opArrIndex=0;
    
    for(int i=0; i<nums.length; i += 2)
    {
        opArrSize += nums[i];
    }
    
    intArr= new int[opArrSize];
    
    
    for(int j=0; j<nums.length; j += 2)
    {
        int freq= nums[j];
        int val = nums[j+1];
        
        
        while(freq>0)
        {
           
			
		intArr[opArrIndex] = val;
			
			freq--;
			opArrIndex++;
		
        }
        
    }
    
    return intArr;
}

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