For this Question: Given an array consisting of N integers, your task is to reverse every subarray of K group elements.
See example for better understanding.First line of input contains two space separated integers N and K, next line contains N space separated integers containing values of array.

Constraints:-
1 < = K < = N < =100000
1 < = Arr[i] < = 100000Print the modified array.Sample Input:-
6 2
1 2 3 4 5 6

Sample Output:-
2 1 4 3 6 5

Sample Input:-
5 3
1 2 3 4 5

Sample Output:-
3 2 1 4 5

Explanation:
Step 1: 3 2 1 4 5
No more steps can be done, I have written this Solution Code: import java.io.*;
import java.util.*;



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

		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		String str[] = read.readLine().trim().split(" ");
		int n = Integer.parseInt(str[0]);
		int arr[] = new int [n];
		int k = Integer.parseInt(str[1]);

		str = read.readLine().trim().split(" ");
		for(int i=0;i<n;i++){
			arr[i] = Integer.parseInt(str[i]);
		}

		int i = 0;
		while(i+k <= n){
			for(int j=0;j<k/2;j++){
				int temp = arr[i + j];
				arr[i + j] = arr[i + k - j-1];
				arr[i + k - j-1] = temp;
			}
			i+=k;

		}

		for(i=0;i<n;i++){
			System.out.print(arr[i] + " ");
		}
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?