For this Question: Given an array Arr with N distinct integers from 1 to N. If you are currently at index i then in a single jump you move to the index Arr[i]. You start at standing at index 1. Find the index you will be after K jumps.First line of input contains two integers N and K.
Second line of input contains N integers, denoting Arr.

Constraints:
1 <= N <= 100000
1 <= K <= 1000000000000
1 <= Arr[i] <= NPrint the index you will be on after K jumps.Sample Input 1
5 3
3 4 2 5 1

Sample Output 1
4

Explanation: 
You start at index 1

After first jump you reach index 3
 
After second jump you reach index 2
 
After third jump you reach index 4, 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));
		StringTokenizer str = new StringTokenizer(read.readLine());

		int N = Integer.parseInt(str.nextToken());
		long K = Long.parseLong(str.nextToken());

		int[] arr = new int[N];
		StringTokenizer newStr = new StringTokenizer(read.readLine());

		for(int i=0; i<N; i++) {
			arr[i] = Integer.parseInt(newStr.nextToken());
		}

		long count = 0;
		int ele = 1;
		long copyOfK = K;



		while(K > 0) {
			ele = arr[ele - 1];

			count++;
			K--;
			if(ele == 1) {
				K = copyOfK % count;


			}
		}

		System.out.print(ele);




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