Pregunta de entrevista de Amazon

Dynamic programming questions (dsa) and a graph problem.