Apple Interview Question

Got asked a binary search leetcode question.