DEV: Challenge Accepted ’23 – Task 15

Write a function to check if a given directed graph contains a cycle. Explain the algorithm you would use and its time complexity.