TuSimple interview question

Coding questions about BFS in 2d