for(;i<arr.length;i++)
{
//System.out.println(i);
//System.out.println(arr[q.getFirst()]+" ");
while(!q.isEmpty() && q.getFirst()<=i-size)
{
q.removeFirst();
}
q.addLast(i);
}
Didn’t understood how q.getFirst()<=i-size condition is helping to find current window ?