Pregunta de entrevista de Google

graph question and dynamic programing question