Pregunta de entrevista de Amazon

clone a graph which has cycles