Amazon Interview Question

I forget the question but the solution was just a modified binary search, pretty simple.