Sliding windows problems

I didn’t understand the problems although i read it on gfg . I didn’t get what is happening after the first windows in the first windows we are storing the addressing index of the largest element and the other forward elements that might be useful for the another windows.
After that :((((

yr
deko hum basically largest element ka index front meh rakhna h
to hum basically har bar right shift 1 time se kar rahe h initiall k size traverse karne ke badd

and add karne se pehle front me jo element apni window ke ‘k’ range meh nhi h
vo remove kardo
while ((!Qi.empty()) && Qi.front() <= i - k)

Qi.pop_front();

then we are bascially remove elements from element till the time deque ka back is smaller than present element
while ((!Qi.empty()) && arr[i] >= arr[Qi.back()])

Qi.pop_back();


method 3

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.