Pregunta de entrevista de Expedia Group

Cannot give explicit details. Question involved finding cycles in a directed graph