Pregunta de entrevista de ByteDance

Implement a function to sort tasks that are interdependent.