For this Question: Given an array of N integers and an integer K, your task is to print the number of distinct elements present in every window of size K.First line of input contains two space- separated integers N and K, the next line contains N space- separated integers depicting the values of the array.

Constraints:-
1 <= K <= N <= 100000
1 <= Arr[i] <= 1000Print (N- K+1) integers, the number of distinct elements for all window of size K.Sample Input:-
6 3
1 2 3 2 2 3

Sample Output:-
3 2 2 2

Explanation:
for the 1st window of size 3, elements are: 1 2 3
thus the number of distinct elements would be: 3
Similarly, for the 2nd window: 2
3rd window: 2
4th window: 2

Sample Input:-
6 4
1 2 3 3 2 1

Sample Output:-
3 2 3, I have written this Solution Code: 
#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795
#define max1 101
#define MOD 1000000007

#define read(type) readInt<type>()

#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}

signed main(){
    fast();
  
int n,k;
cin>>n>>k;
int A[n];
FOR(i,n){
cin>>A[i];}
unordered_map<int,int> m;
   int cnt=0;
   for(int i=0;i<k;i++){
       m[A[i]]++;
   }
   cnt=m.size();
   vector<int> v;
   v.emplace_back(cnt);
   for(int i=k;i<n;i++){
       m[A[i-k]]--;
       if(m[A[i-k]]==0){cnt--;}
       m[A[i]]++;
       if(m[A[i]]==1){cnt++;}
       v.emplace_back(cnt);
   }
   FOR(i,v.size()){
   out1(v[i]);}
}

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