Amazon interview question

Sliding Window, Binary Search on Answer