Write code to detect cycles in a directed graph.

Technical