Order the Courses

Talk it through out loud with your AI coach.

The problem

  • medium
  • Pro

You must take a set of courses, and some courses must be taken before others. Produce an order in which you can take them all, or report that it's impossible. Explain the algorithm and how it detects the impossible case.