Veeva Systems Interview Question

BFS in a matrix