Amazon Interview Question

coding: binary search, easy to medium