Algorithm · Oracle · Medium
You are given a directed graph. Determine whether there is at least one directed cycle anywhere in it: output true if such a cycle exists and false if none does. Note that the graph is not necessarily connected. The original report only states that the task is detecting a directed cycle. The input format and constraints described here are supplementary conventions added for practice and have not been confirmed as part of the actual interview. Input Standard input holds one…