Tesla interview question

Graph question based on Djikstras.