Amazon interview question

Coding question that required binary search