Pergunta de entrevista da empresa ServiceNow

Question in Round 3 on graphs and shortest path