Sixt interview question

Sliding window maximum question with code