For this Question: Write a Program to duplicate an array N number of times.The first line of the input contains two space separated integers N and M - The size of an array and Number of times to be repeated.
The second line contains N space separated integers A<sub>1</sub>, A<sub>2</sub>,. , A<sub>n</sub>.

<b>Constraints</b>
1 &le; N,M &le; 100
1 &le; A[i] &le; 1000Print the required output.Sample Input 
3 2
1 2 3

Sample Output
1 2 3 1 2 3, I have written this Solution Code: import java.io.*;
import java.util.*;



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

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        int[] arr = new int[n*m];
        for(int i=0; i<n; i++){
            arr[i] = Integer.parseInt(st.nextToken());
        }
        for(int i=n, j=0; i<m*n; i++, j++){
            arr[i] = arr[j];
            if(j==n-1) j=-1;
        }
        for(int i=0; i<n*m; i++){
            System.out.print(arr[i]+" ");
        }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?