For this Question: Given an array A[] of size N and an integer K. Print the count of distinct numbers in all subarrays of size k in the array A[].The first line of input contains two integers N and K. The next line contains N space separated values of the array A[].

Constraints:-
1 <= N, K <= 100000
1 <= A[] <= 1000000000Print the space separated values denoting counts of distinct numbers in all subarrays of size k in the array A[].Sample Input :
7 4
1 2 1 3 4 2 3

Sample Output:
3 4 4 3

Explanation:-`
First window's elements is:- 1 2 1 3 which contains 3 different elements.
Second window's elements is:- 2 1 3 4 which contains 4 different elements.
Third window's elements is:- 1 3 4 2 which contains 4 different elements.
Fourth window's elements is:- 3 4 2 3 which contains 3 different elements., I have written this Solution Code: n,k=input().split()
n=int(n)
k=int(k)
arr=input().split()
for i in range(0,len(arr)):
    arr[i]=int(arr[i])
hs={}
for i in range(0,k):
    if arr[i] not in hs:
        hs[arr[i]]=1
    else:
        hs[arr[i]]+=1
print (len(hs),end=' ')
for i in range(k,n):
    if(hs[arr[i-k]]==1):
        del hs[arr[i-k]]
    else:
        hs[arr[i-k]]-=1
    if arr[i] not in hs:
        hs[arr[i]]=1
    else:
        hs[arr[i]]+=1
    print (len(hs),end=' '), In this Programming Language: Python, Now tell me if this Code is compilable or not?