Veeva Systems interview question

BFS in a matrix