Pregunta de entrevista de Booking.com

Cycle detection in directed graph