Pergunta de entrevista da empresa Hitachi Vantara

Write the function to return the sequence in which the tasks will be executed.