Frage im Vorstellungsgespräch bei ByteDance

Implement a function to sort tasks that are interdependent.