Booking.com Interview Question

Classical BFS problem on matrix graph