Pergunta de entrevista da empresa Booking.com

Cycle detection in directed graph