Amazon Interview Question

Question related to BFS Question related to Binary Search