Pregunta de entrevista de Samsung Electronics

Graph question based on shortest path algorithm.