Condition is not clear

why q.front() >= i -k ? can you please explain

the condition is q.front <= ( i - k )
it basically the contraction case
we need to see max element in the window of k size
the front signifies the element greatest in the window size
but as we continue to move in the right direction the window also moves hence in order to remove irrelevant chaaracter that are not in window
we do a check if q.front() <= ( i -k)
eg
let front be 1
and we are at pos 4
and window size is 3
then in that case index 1 would not be included in the window rn would be from 2-4
hence q.front() needs to be popped off

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.