Booking.com interview question

Classical BFS problem on matrix graph