Apple interview question

binary search