Pregunta de entrevista de Uber

One graph problem and a greedy problem