Yext interview question

Blow up mines in a minefield, basic DFS/BFS