I did not understand one thing in solution


why q.front()<=i-k is used in the code
also please help to debugg my code as it is not giving any output

@harryson
hello harshit.
q.front()<=i-k check whether there exist any element in deque which is not in our current window. if it exist then pop all such element from dequeu because they dont contribute anything to our answer.

@harryson
I recommend u to watch the solution video again and then u can easily identify ur mistakes.

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.