Better interview question

related to sliding window array problems