Pergunta de entrevista da empresa Samsung Electronics

Graph question based on shortest path algorithm.