Amazon Interview Question

Q:The first problem is the same for all and is solving with sliding window.