Pregunta de entrevista de Google

dsa question on greedy and graph