Amazon Interview Question

DSA question relating to sliding window