For this Question: Given an array of N integers that may contain duplicate elements and an integer K, find if there exists a pair of integers (i, j) such that i < j and arr[i]=arr[j] and i and j are exactly k distance apart i.e ( j - i ) = k.The first line of input contains two integers N and K, next line contains N space-separated integers.

<b>Constraints:-</b>
1 < = N < = 10<sup>5</sup>
1 < = K < = N
1 < = Arr[i] < = 10<sup>9</sup>Print 1 if there exist elements else print 0.Sample Input:
4 3
1 2 2 1

Sample Output:
1

<b>Explanation:- </b>
Pair at index 1, 4 is the required answer so output=1, I have written this Solution Code: N,K = list(map(int,input().split()))
arr = list(map(int,input().split()))

flag = False	
for i in range(K,N):
	if arr[i-K] == arr[i]:
		flag = True
		break

if flag:
	print("1")
else:
	print("0"), In this Programming Language: Python, Now tell me if this Code is compilable or not?