Apple Interview Question

Got asked a binary search iterator question from leetcode, got asked both the recursive and the iterative approach