Kraken Interview Question

coding: BFS over a matrix