Pregunta de entrevista de Google

Graph question, finding shortest path