For this Question: Sara loves problems on permutation but this time she stuck on a problem and asks for your help.
Given a permutation of N integers as Arr[], your task is to check for each K(1 <= K <= N) there exists a subarray of size K such that it is also a permutation of K integers.

Note:- A permutation of N integers is a sequence of size N where every element from 1- N are present.The first line of input contains a single integer N denoting the size of permutation, the next line of input contains N space separated integers depicting the permutaiton.

Constraints:- 
1 <= N <= 100000
1 <= Arr[i] <= NPrint N space separated integers either 1 or 0. Print 1 if there exist a permutation K for the ith number else print 0.Sample Input:-
6
4 5 1 3 2 6

Sample Output:-
1 0 1 0 1 1

Explanation:-
for k=1 permutaion exist from [3, 3]
for k=2 no permutaion exists
for k=3 permutaion exist from [3, 5]
for k=4 no permutaion exists
for k=5 permutaion exist from [1, 5]
for k=6 permutaion exist from [1, 6]

Sample Input:-
6
6 5 4 3 2 1

Sample Output:-
1 1 1 1 1 1, I have written this Solution Code: def find_permutations(arr):
	max_ind = -1
	min_ind = 10000000;	
	n = len(arr)
	index_of = {}

	for i in range(n):
		index_of[arr[i]] = i + 1

	for i in range(1, n + 1):
		max_ind = max(max_ind, index_of[i])
		min_ind = min(min_ind, index_of[i])		
		if (max_ind - min_ind + 1 == i):
			print(1,end = " ")
		else:
			#print( "i = ",i)
			print(0,end = " ")

n = int(input())
arr = list(map(int, input().split()))
find_permutations(arr), In this Programming Language: Python, Now tell me if this Code is compilable or not?