Amazon interview question

one coding question on binary search