Given an array A and a value k, find the number of distinct elements in each window (subarray) of size k.
A: [1, 1, 2, 1, 4, 6, 5]
k: 3
Result: [2, 2, 3, 3, 3]
The first line contains an integer ‘T’ denoting the number of test cases.
For each test case, the input has three lines:
For each test case, the output has one line with (n-k+1) space separated integers denoting the number of different elements in each window of size k.
3
7
1 1 2 1 4 6 5
3
4
1 1 1 4
2
5
1 1 2 1 1
2
2 2 3 3 3
1 1 2
1 2 2 1
1 <= T <= 10
1 <= n <= 105
1 <= Ai <= 109
1 <= k <= n