title: For each test case, display the minimum number of days necessary to complete the plan. ALGORITHM ideas?
body: <p>I have to write code to solve this question.  but first, I have to come up with an algorithm for it.  I have no idea how to do it.  Here is the question and what I was thinking of doing:</p>
  
  <blockquote>
    <p>The Canadian Space Agency (CSA) is in a race with their
    American and Russian counterparts (NASA and Roscosmos, resp.) to land the rst man on the
    Mars. They have broken down their plan into n tasks each taking exactly one day. Each task can
    only be started when all its prerequisite tasks has nished. Clearly, there is no circular dependency
    between the tasks. The CSA needs your help to determine the minimum number of days necessary
    to complete the plan.</p>
  </blockquote>
  
  <p>we are given a list containing the prerequisites for each task, so I know which task has which prerequisite.  for example. a list like <code>[[1,2,3],[],[],[]]</code> means that task 0 has prerequisites 1,2,3 and the other 3 tasks have no prerequisites.</p>
  
  <p>what i was thinking of doing was checking every list and checking if it is 0-length. if it is, increase the day count by 1.  if it is not, iterate through the prerequisites and see if any of those can be done. if any of the prerequisites have prerequisites, i have to do those first.</p>
  
  <p>I understand the theory, i just have no idea how to implement this.  I need to somehow keep track of the prerequisites I finished doing and then remove these prerequisites from any task that has it as a requirement.  I understand i could just make a list, but if the list input file is extremely large, it would take a long time, and my algorithm has to return an input iin under 1 second.</p>
  
  <p>any help figuring out this algorithm would be greatly appreciated.</p>