Applied Intuition interview question

BFS problem (related with autonomous vehicles)