Better Interview Question

related to sliding window array problems